Reputation: 5041
This is the first time I use NSOperation/NSOperationQueue.
I wrote a NSOperation subclass that handles JSON export of a lot of data, because I want the UI to stay responsive during a longer export.
To which queue do I add my operation:
- the [NSOperationQueue mainQueue] or
- to a new NSOperationQueue, [[NSOperationQueue alloc] init]?
And what is the reasoning behing the decision?
Upvotes: 0
Views: 88
Reputation: 31016
The main queue uses the same thread that handles UI operations. You want long operations sent to a background queue and then anything that displays the operation's results should come back to the main queue.
Upvotes: 2