Re: Mutable to-many relationship not observable
Re: Mutable to-many relationship not observable
- Subject: Re: Mutable to-many relationship not observable
- From: Remco Poelstra <email@hidden>
- Date: Mon, 17 Jan 2011 09:25:07 +0100
Op 15-1-2011 9:19, Ken Thomases schreef:
Which will/didChange... methods do you use, when you've tested the manual notifications?
Also, what does your -observeValueForKeyPath:ofObject:change:context: method look like?
My suspicion is that you're using will/didChangeValueForKey: and your observe... method is expecting the value of the NSKeyValueChangeKindKey to be NSKeyValueChangeSetting.
Instead, the automatic notifications from the mutating indexed accessors is more akin to what's generated by will/didChange:valuesAtIndexes:forKey:, and NSKeyValueChangeKindKey will be one of NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, or NSKeyValueChangeReplacement.
Your suspicion was right. I had implemented it completely the wrong way.
Works perfect now. Thanks.
Regards,
Remco Poelstra
_______________________________________________
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