On 09/07/2009, at 9:49 AM, Kiel Gillard wrote:

To prevent this behaviour, you could override setName: to only change the value when the pointers are not the same.


That doesn't change the automatic KVO notification behaviour, which takes effect 'outside' of the method itself. Whatever the method does internally, the 'will change' goes out before it runs and the 'did change' after.

You can prevent the KVO notification if you suppress the automatic notification for that property (override +automaticallyNotifiesObserversForKey: to return NO for that key) and add the will change/did change calls manually to your code only when the value has changed.

--Graham


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to