This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (id)objectAtKeyedSubscript:(id <NSCopying>)key | |
| { | |
| return [self.registeredClasses objectForKey:key]; | |
| } | |
| - (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key | |
| { | |
| [self registerClass:(NSString *)key forCellWithReuseIdentifier:obj]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| print("hello world") | |
| let myConstVar = 2; //let定义常量 | |
| var myVar = 3 ;//var定义变量 | |
| let explicitDouble:Float=4 | |
| let apple = 3.1415 | |
| let str = "\(apple) apple" | |
| var array=["1","2","3"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(overtimeRemind) object:nil]; | |
| 先看这段代码: | |
| - (void)viewDidAppear:(BOOL)animated { | |
| [super viewDidAppear:animated]; | |
| [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(showLeft) object:nil]; | |
| [self performSelector:@selector(showLeft)]; | |
| } | |
| - (void)viewDidAppear:(BOOL)animated { | |
| [super viewDidAppear:animated]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| CREATE TABLE -- 创建表 | |
| JF_Person -- 表的名称 | |
| ( -- 里面是表的字段 | |
| id -- 字段 | |
| INTEGER -- 类型 | |
| NOT NULL -- 不能为空 | |
| PRIMARY KEY -- 主键 | |
| AUTOINCREMENT -- 字段 | |
| name -- 字段 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1.title | |
| 获取或设置UIAlertView上的标题。 | |
| 2.message | |
| 获取或设置UIAlertView上的消息 | |
| UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://blog.6ag.cn/1080.html | |
| 推送通知也属于UI的一部分,所以推送通知对象是以UI开头。 | |
| 将发送通知的代码方法控制器的-touchesBegan: withEvent: 中测试比较合适,如果放到viewDidLoad方法,用户的注册请求还没有完成方法就调用了。 | |
| 创建本地通知对象 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| swift实现单例的四种方式 | |
| 单例模式是设计模式中最简单的一种,甚至有些模式大师都不称其为模式,称其为一种实现技巧,因为设计模式讲究对象之间的关系的抽象,而单例模式只有自己一个对象。 | |
| 当你只需要一个实例的时候需要使用单例,如UIApplication.sharedApplication() 等 ,windows的任务管理器、回收站,都是只能同时存在一个。 | |
| 下面看看swift中的几种实现方式: | |
| 一、一句话搞定,静态常量 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://github.com/walkingway/MantleExample |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UIView和CALayer的区别和联系 | |
| 1, uiview 是uikit的(只能iOS使用) calayer 是QuartzCore的(ios 和mac os通用) | |
| 2, calayer 比uiview更加轻量级别, 但是可以实现同样的效果 | |
| 3, uiview比calayer多了一个事件处理的功能,也就是说,CALayer 不能处理用户的触摸事件,而UIView可以 | |
| 4, UIView的CALayer类似UIView的子View树形结构 |