上一页 1 ··· 3 4 5 6 7 8 下一页

2015年9月7日

同步,异步,串行,并行队列

摘要: 1 #import "ViewController.h" 2 3 @interface ViewController () 4 5 @end 6 7 @implementation ViewController 8 9 - (void)viewDidLoad { 10 [super viewDidLoad]; 11 // Do an... 阅读全文

posted @ 2015-09-07 15:06 Baymax01 阅读(217) 评论(0) 推荐(0) 编辑

线程的优先级

摘要: 1 NSThread *t1 = [[NSThread alloc] initWithTarget:self selector:@selector(createThreadOne) object:nil]; 2 t1.name = @"线程A"; 3 //修改优先级 4 t1.threadPriority = 0; 5 [t1 start]; ... 阅读全文

posted @ 2015-09-07 15:03 Baymax01 阅读(143) 评论(0) 推荐(0) 编辑

NSThread创建线程

摘要: 1 #import "ViewController.h" 2 3 @interface ViewController () 4 5 @end 6 7 @implementation ViewController 8 9 - (void)viewDidLoad { 10 [super viewDidLoad]; 11 // Do any additiona... 阅读全文

posted @ 2015-09-07 14:57 Baymax01 阅读(147) 评论(0) 推荐(0) 编辑

线程NSOperationQueue

摘要: 1.NSOperationQueue下载图片 1 #import "ViewController.h" 2 #import "ImageOperation.h" 3 4 @interface ViewController () 5 { 6 NSOperationQueue *_queue; 7 } 阅读全文

posted @ 2015-09-07 14:54 Baymax01 阅读(135) 评论(0) 推荐(0) 编辑

KVC

摘要: 使用:[fanye setValuesForKeysWithDictionary:dic];如果出现关键字,则重写setter方法@property (nonatomic,copy,setter=setDescription:)NSString *myDescription;记得在.m文件加上-(v... 阅读全文

posted @ 2015-09-07 14:49 Baymax01 阅读(119) 评论(0) 推荐(0) 编辑

跳转到AppStore下载

摘要: //跳转到appstore界面 if (self.dItem.itunesUrl) { //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.dItem.itunesUrl]]; NSString *url =... 阅读全文

posted @ 2015-09-07 14:32 Baymax01 阅读(266) 评论(0) 推荐(0) 编辑

数组的懒加载

摘要: //懒加载方式初始化数组(要用到数组时才初始化)-(NSMutableArray *)nearbyArray{ if (_nearbyArray == nil) { _nearbyArray = [NSMutableArray array]; } return _nearbyArray;}//调用L... 阅读全文

posted @ 2015-09-07 14:30 Baymax01 阅读(271) 评论(0) 推荐(0) 编辑

Block的强强引用问题(循环引用)

摘要: 1 //block传值 2 __weak SubjectViewController *weakSelf = self;//解决强强引用的问题 3 cell.clickBlock = ^(AppItem *aItem){ 4 DetailViewControlle... 阅读全文

posted @ 2015-09-07 14:15 Baymax01 阅读(300) 评论(0) 推荐(0) 编辑

自己封装的下载方法

摘要: 1.MyDownloader.h文件 1 #import <Foundation/Foundation.h> 2 3 //前置声明 4 @class MyDownloader; 5 //协议 6 @protocol MyDownloaderDelegate <NSObject> 7 8 //下载失败 阅读全文

posted @ 2015-09-07 14:10 Baymax01 阅读(215) 评论(0) 推荐(0) 编辑

MJRefresh上拉刷新下拉加载

摘要: 1.创建 1 //下拉刷新 2 _headerView = [MJRefreshHeaderView header]; 3 _headerView.scrollView = _tbView; 4 _headerView.delegate = self; 5 6 ... 阅读全文

posted @ 2015-09-07 14:05 Baymax01 阅读(191) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 下一页

导航