Re: loop efficiency & messages
Re: loop efficiency & messages
- Subject: Re: loop efficiency & messages
- From: Sherm Pendley <email@hidden>
- Date: Wed, 23 Mar 2005 13:48:09 -0500
On Mar 23, 2005, at 12:39 PM, Charilaos Skiadas wrote:
In that case, I don't get it. Where in the documentation does it
specify that getKey should be used in the manner Charlton described?
And why are we encouraged to implement key instead of getKey, but
getKey is searched for first?
I think Charlton was referring to the common use of -getKey: (note the
colon) as a method which takes the address of a target buffer as an
argument, and copies the value of the requested key into that buffer. I
think the preference for -key rather than -getKey (no colon) is because
of the second one's close resemblance to its argument-accepting
sibling. The compiler has no problem distinguishing between them, of
course, even in a class that has both, but for us humans it's a
readability issue.
Another reason is that Nib-loading machinery, for as long as I can
recall, doesn't call valueForKey:. Instead, it has its own KVC
implementation, and if I recall correctly, that one *doesn't* call
-getKey. It simplifies things to apply one consistent policy that works
with both IBOutlets and general KVC keys.
I never said that using -getKey was easy, or a good idea. I just said
it's not impossible. ;-)
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
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