• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: loop efficiency & messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: loop efficiency & messages (From: Will Mason <email@hidden>)
 >Re: loop efficiency & messages (From: Charilaos Skiadas <email@hidden>)
 >Re: loop efficiency & messages (From: Sherm Pendley <email@hidden>)
 >Re: loop efficiency & messages (From: Charilaos Skiadas <email@hidden>)

  • Prev by Date: Re: loop efficiency & messages
  • Next by Date: Re: loop efficiency & messages
  • Previous by thread: Re: Cocoa coding style (was loop efficiency & messages)
  • Next by thread: Re: loop efficiency & messages
  • Index(es):
    • Date
    • Thread