• 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: Accessor method naming (a question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessor method naming (a question)


  • Subject: Re: Accessor method naming (a question)
  • From: Cameron Hayne <email@hidden>
  • Date: Thu, 9 Jun 2005 18:40:31 -0400

On 9-Jun-05, at 6:26 PM, Larry Gerndt wrote:
NSView defines "isHidden" and "setHidden". Shouldn't this be "isHidden" and "setIsHidden"? If not, then Accessorizor won't work, because if your ivar is name "isHidden", it will produce "setIsHidden". I guess the question is, how serious a violation of the coding rules is "setIsHidden" as opposed to "setHidden"?

"hidden" is an adjective, and hence this is the relevant section of the document you looked at:
If the attribute is expressed as an adjective, the format is:
- (void)setAdjective:(BOOL)flag;

- (BOOL)isAdjective;

For example:

- (void)setEditable:(BOOL)flag;

- (BOOL)isEditable;


--
Cameron Hayne
email@hidden


_______________________________________________ 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: 
 >Accessor method naming (a question) (From: Larry Gerndt <email@hidden>)

  • Prev by Date: Re: Accessor method naming (a question)
  • Next by Date: Re: Accessor method naming (a question)
  • Previous by thread: Re: Accessor method naming (a question)
  • Next by thread: Re: Accessor method naming (a question)
  • Index(es):
    • Date
    • Thread