• 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: Ondra Cada <email@hidden>
  • Date: Fri, 10 Jun 2005 00:34:57 +0200

Larry,

On 10.6.2005, at 0:26, Larry Gerndt wrote:

Quoting from Apple's coding guidelines, located at: http:// developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/ index.html

<quote>
"If the attribute is expressed as a verb, the format is:
- (void)setVerbObject:(BOOL)flag;

- (BOOL)verbObject;

For example:

- (void)setShowsAlpha:(BOOL)flag;
- (BOOL)showsAlpha;"
<quote/>

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"?

isXXX is a somewhat special case. See the "If the attribute is expressed as an adjective" part with the "setEditable:" example in the very guide you quoted :)
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



_______________________________________________ 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
  • Follow-Ups:
    • Re: Accessor method naming (a question)
      • From: Kevin Callahan <email@hidden>
References: 
 >Accessor method naming (a question) (From: Larry Gerndt <email@hidden>)

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