On Sun, Sep 30, 2012 at 7:20 PM, Koen van der Drift
<koenvanderdr...@gmail.com> wrote:
>
> On Sep 30, 2012, at 6:51 PM, Ken Thomases <k...@codeweavers.com> wrote:
>
>> Move the long-running operation to a background thread (e.g. using 
>> -performSelectorInBackground:withObject:, or dispatch_async() to a non-main 
>> queue, or NSOperation and NSOperationQueue, etc.).  However, all updates to 
>> the GUI still have to happen on the main thread.  Therefore, all updates of 
>> properties to which the GUI is bound have to happen on the main thread.  You 
>> can shunt those over using -performSelectorOnMainThread:..., 
>> dispatch_[a]sync to the main queue, NSOperation and +[NSOperationQueue 
>> mainQueue], etc.
>
> Thanks, I'll try that.

Ok, I decided to use NSOperation(Queue) as it is generally recommended
over performSelectorXXX to be a more modern API, and have been reading
a bit about it.  In Hillegass' Cocoa book, he uses processQueue
addOperationWithBlock, in other examples on the webs, people make
subclasses of NSOperation to put their tasks in. What's the difference
between these two appraches (if any)?

Thanks,

- Koen.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to