开发者

Run NSOperation on Main Thread

开发者 https://www.devze.com 2023-03-11 23:42 出处:网络
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

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

精彩评论

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