• 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: Is there a convention...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a convention...


  • Subject: Re: Is there a convention...
  • From: Chris Hanson <email@hidden>
  • Date: Sun, 28 Jul 2002 01:41:59 -0500

At 9:26 PM -0700 7/27/02, Jeff LaMarche wrote:
However, I still create accessor methods and setter (is that the right
term) methods to make it easier to implement NSCoding and NSCopying. I'm
never sure how to name these methods, however. Is there a convention?

The convention would be to have a setter whose name starts with an underscore rather than any of the ones you listed.

-takeValue:forKey: tries to locate and use, in order:

* a -setKey: method,
* a -_setKey: method,
* a key instance variable,
* a _key instance variable (ditto),

and sends -handleTakeValue:forUnboundKey: if none of the above works.

(This is why I use Cocoa Browser, rather than Project Builder, for doc browsing. Foundation Protocols > NSKeyValueCoding > Instance Methods > -takeValue:forKey: helped me locate the information in a few seconds. And it doesn't clutter up my editor window either.)

-- Chris

--
Chris Hanson | Email: email@hidden
bDistributed.com, Inc. | Phone: +1-847-372-3955
Making Business Distributed | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
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: 
 >Is there a convention... (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: Memory allocation questions
  • Next by Date: Re: (no subject)
  • Previous by thread: Is there a convention...
  • Next by thread: Memory allocation questions
  • Index(es):
    • Date
    • Thread