Re: Setters, Getters and efficiency
Re: Setters, Getters and efficiency
- Subject: Re: Setters, Getters and efficiency
- From: mmalcolm crawford <email@hidden>
- Date: Sun, 11 Dec 2005 11:38:27 -0800
On Dec 11, 2005, at 11:27 AM, Andrei Tchijov wrote:
"...accessor methods are always tried first..." - this is not
always a case. If class overwrite 'valueForKey:/setValue:forKey:'
method, then "all bets are off". For example, NSMutableDictionary
does it, so if you will have class which is derived from it, then
all your setters/getters are going to be ignored by KVC code
(unless you overwrite these 2 methods yourself to restore default
semantic).
<sigh>
All bets are not off. If valueForKey: and setValue:forKey do
something different, then it is called out in the documentation, and
the pattern explained -- IIRC there are only two classes for which
this is the case, NSMutableDictionary and NSArray. This is not
typical for model classes, though, and not really relevant to the
pattern/issue here...
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden