随笔分类 -  多线程

线程间通信
摘要://创建url NSURL *url = [NSURL URLWithString:str]; //创建请求 NSURLRequest *request = [NSURLRequest requestWithURL:url]; //发送请求// NSOperationQueue *queue = ... 阅读全文
posted @ 2015-09-24 00:32 菜鸟onTheLoad 阅读(102) 评论(0) 推荐(0)
延迟执行
摘要:// 延迟执行不要用sleep,坏处:卡住当前线程 [NSThread sleepForTimeInterval:(NSTimeInterval)];// 一旦定制好延迟任务后,不会卡主当前线程[self performSelector: withObject: afterDelay:];//n秒后... 阅读全文
posted @ 2015-09-23 00:11 菜鸟onTheLoad 阅读(176) 评论(0) 推荐(0)