Re: KVO Oddity
Re: KVO Oddity
- Subject: Re: KVO Oddity
- From: Scott Anguish <email@hidden>
- Date: Thu, 13 May 2004 19:03:00 -0400
On May 13, 2004, at 4:46 PM, Chris Pavicich wrote:
Hi List:
I am working on a simple application using KeyValueObserving. And have
run into some interesting behaviour
using setKeys:triggerChangeNotificationsForDependentKey: The class I
am working with is below.
If I call setKeys:... using @"_attributes" and _attributes is changed
a change notification is never sent.
If I call setKeys:... using @"attributes" and _attributes is changes,
the notification IS sent.
Perhaps, I don't quite get what's going on, but shouldn't
'_attributes' and 'attributes' be interchangeable in this
case?
_ as the first character of a variable is reserved.
KVC will look for _ in the variable name if you asked for attributes,
but didn't implement -attributes,
So, the moral is, don't use _ and don't try and bypass your accessors
using KVC.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >KVO Oddity (From: Chris Pavicich <email@hidden>) |