摘要:
1、NSOperation的作用以及特点 (1)是OC语言中基于GCD的面向对象的封装,NSOperation是iOS2.0推出的,iOS4之后(GCD出现)重写了NSOperation。 (2)使用起来比GCD更加简单(面向对象)。同时, 阅读全文
摘要:
本文只对GCD的其他操作进行一些补充。1、延迟操作 实例://延时操作 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 阅读全文
摘要:
1、一套通用的多线程API,纯C语言,操作难度大,在iOS开发中基本不使用。2、基本使用方式#import <pthread.h> //线程编号的地址,本质是结构体类型 pthread_t pthread; //方法的返回值:0 成功, 其它失败 int result = 阅读全文
摘要:
1、创建新线程的三种方式,例如:NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(demo:) object:nil];[thread start];[NSThread detachNewThrea 阅读全文