Re: NSTextField not updated during large process
Re: NSTextField not updated during large process
- Subject: Re: NSTextField not updated during large process
- From: Koen van der Drift <email@hidden>
- Date: Mon, 01 Oct 2012 08:59:50 -0400
On Sun, Sep 30, 2012 at 7:20 PM, Koen van der Drift
<email@hidden> wrote:
>
> On Sep 30, 2012, at 6:51 PM, Ken Thomases <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden