摘要: UIView *blueView = [[UIView alloc] init]; [self.view addSubview:blueView]; blueView.backgroundColor = [UIColor blueColor]; blueView.center = self.view.center; blueView.bounds = CGRec... 阅读全文
posted @ 2015-06-23 13:53 邓小君 阅读(136) 评论(0) 推荐(0) 编辑
摘要: @property (nonatomic, copy) NSString *icon;@property (nonatomic, copy) NSString *name; -(instancetype) initWithDic:(NSDictionary *)dic; +(instancetype) appViewWithDic:(NSDictionary *)dic;-(instancety... 阅读全文
posted @ 2015-06-23 13:45 邓小君 阅读(165) 评论(0) 推荐(0) 编辑
摘要: •深复制(深拷贝,内容拷贝,deepcopy)Ø源对象和副本对象是不同的两个对象Ø源对象引用计数器不变,副本对象计数器为1(因为是新产生的)Ø本质是:产生了新的对象Ø•浅复制(浅拷贝,指针拷贝,shallowcopy)Ø源对象和副本对象是同一个对象Ø源对象(副本对象)引用计数器+1,相当于做一次retain操作Ø本质是:没有产生新的对象 阅读全文
posted @ 2015-06-23 13:41 邓小君 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 结合NSCalendar和NSDate能做更多的日期\时间处理 获得NSCalendar对象NSCalendar *calendar = [NSCalendar currentCalendar];获得年月日- (NSDateComponents *)components:(NSCalendarUnit)unitFlags fromDate:(NSDate *)date;//创建日期 NSDate... 阅读全文
posted @ 2015-06-23 13:40 邓小君 阅读(411) 评论(0) 推荐(0) 编辑
摘要: [fileManager isDeletableFileAtPath:]; 判断一个路径是否可删除[fileManager isWritableFileAtPath:];判断一个路径是否可写[fileManager isReadableFileAtPath:];判断一个路径是否可读[fileMana... 阅读全文
posted @ 2015-06-23 13:38 邓小君 阅读(826) 评论(0) 推荐(0) 编辑
摘要: 父类指针可以指向子类对象//定义block别名。typedef void (^LYItemOption)(); @interface LYItemArrow : LYItem@property(nonatomic,strong) Class desController;@property(nonatomic,copy) LYItemOption option;1.strong :除NSSt... 阅读全文
posted @ 2015-06-23 13:35 邓小君 阅读(2090) 评论(0) 推荐(1) 编辑
摘要: GCD 是c语言的框架,不需要手动管理内存是一个面向任务 不是面向线程,不需要管理线程的生命周期GCD 任务/队列 执行函数任务:Block 任务都封闭在Block中。 —— 线程执行队列:存放任务 FIFO (先进先出的原则) GCD中的队列: 串行队列:想... 阅读全文
posted @ 2015-06-23 11:41 邓小君 阅读(297) 评论(0) 推荐(0) 编辑
摘要: GCD 是c语言的框架,不需要手动管理内存是一个面向任务 不是面向线程,不需要管理线程的生命周期GCD 任务/队列 执行函数任务:Block 任务都封闭在Block中。 —— 线程执行队列:存放任务 FIFO (先进先出的原则) GCD中的队列: 串行队列:想... 阅读全文
posted @ 2015-06-23 11:00 邓小君 阅读(51) 评论(0) 推荐(0) 编辑