Adrian Harris Crowne
Adrian Harris Crowne

Reputation: 1365

Run NSOperation on Main Thread

I built a NSOperation to run on a background 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?

Upvotes: 1

Views: 5234

Answers (1)

Joshua Smith
Joshua Smith

Reputation: 6621

You can do this in the NSOperationQueue by using mainQueue

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

Upvotes: 4

Related Questions