Re: KVO, which thread?
Re: KVO, which thread?
- Subject: Re: KVO, which thread?
- From: Mike Abdullah <email@hidden>
- Date: Mon, 04 Feb 2013 22:35:29 +0000
On 4 Feb 2013, at 21:44, Todd Heberlein <email@hidden> wrote:
> I have an NSInvocationOperation, anOp, and register to observe when its isFinished variable is set
>
> [anOp addObserver:self forKeyPath:@"isFinished" options:NSKeyValueObservingOptionNew context:NULL];
>
> When my operation is done, isFinished is set, and thus my method -observeValueForKeyPath:ofObject:change:context: is called, which thread is it being called on? The main thread, or the thread created to process the NSInvocationOperation?
Unless something in NSOperation goes out of its way to deliver the notification on a particular thread, the answer is: whichever thread caused the KVO notification to be fired.
_______________________________________________
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