摘要: iOS多线程开发 NSThread iOS 支持多个层次的多线程编程,层次越高的抽象程度越高,使用起来也越方便,也是苹果最推荐使用的方法。下面根据抽象层次从低到高依次列出iOS所支持的多线程编程范式: 1, Thread; 2, Cocoa operations; 3, Grand Central ... 阅读全文
posted @ 2012-03-29 14:43 wujian1360 阅读(3536) 评论(1) 推荐(2) 编辑
摘要: NSThread是起线程的主角,大部分时候我们使用这个类。 建一个view-based application. 在viewcontroller.h中 @interface tNSThreadViewController : UIViewController { NSThread... 阅读全文
posted @ 2012-03-29 11:39 wujian1360 阅读(1551) 评论(0) 推荐(0) 编辑
摘要: 等待20秒: [NSThread sleepForTimeInterval:20]; 问: 用这两个下载图片,为什么明显能感觉到dispatch慢,代码那里有问题吗? - (IBAction) startDownLoad:(id)sender { [activity startA... 阅读全文
posted @ 2012-03-29 11:35 wujian1360 阅读(1424) 评论(0) 推荐(0) 编辑