NSOperation与GCD区别,更新UI的3种方式

来源:互联网 发布:sql语句大全实例教程 编辑:程序博客网 时间:2024/06/08 04:39

1.更新UI的方法

[self.mainImageViewperformSelectorOnMainThread:@selector(setImage:)withObject:image waitUntilDone:YES];//

[NSOperationQueue mainQueue] addOperationWithBlock....

dispatch_get_main_queuse()---也就说CGD


3.线程之间如果使用依赖关系...注意死循环

Boock也是

_weak typeof  ARC     解决循环引用
_block typeof  非ARC 解决循环引用









0 0
原创粉丝点击