标签:苹果公司 view imei 主线程 mil text sdn unicode current
- (void)viewDidLoad { [super viewDidLoad]; // 获得全局队列 dispatch_queue_t q = dispatch_get_global_queue(0, 0); // 运行同步任务 dispatch_sync(q, ^{ // 让运行该任务的线程休眠2s [NSThread sleepForTimeInterval:2.0]; NSLog(@"block - %@",[NSThread currentThread]); }); NSLog(@"viewDidLoad - %@",[NSThread currentThread]); }
- (void)viewDidLoad { [super viewDidLoad]; // 获得全局队列 dispatch_queue_t q = dispatch_get_global_queue(0, 0); // 运行异步任务 dispatch_async(q, ^{ // for (int i = 0; i<10; i++) { NSLog(@"block - %@ - %d",[NSThread currentThread],i); } }); NSLog(@"viewDidLoad - %@",[NSThread currentThread]); }
- (void)viewDidLoad { [superviewDidLoad]; //获得全局队列 dispatch_queue_t q =dispatch_get_global_queue(0, 0); //运行异步任务 for (int i = 0; i< 10; i++) { dispatch_async(q, ^{ NSLog(@"block - %@ - %d",[NSThreadcurrentThread],i); }); } NSLog(@"viewDidLoad - %@",[NSThreadcurrentThread]); }
标签:苹果公司 view imei 主线程 mil text sdn unicode current
原文地址:http://www.cnblogs.com/clnchanpin/p/6809010.html