开发者

Run NSOperation on Main Thread

I built a NSOperation to run on a background 开发者_Go百科thread, but I have since optimized the operation such that I might be better suited running it in the main thread. Is there a way to direct my NSOperation to run on the main thread instead of a background thread so that I can test things out without significant refactoring?


You can do this in the NSOperationQueue by using mainQueue

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSOperationQueue_class/Reference/Reference.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜