• 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: "get" prefixes in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "get" prefixes in Cocoa


  • Subject: Re: "get" prefixes in Cocoa
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 30 Jul 2008 11:53:07 -0500

On Jul 30, 2008, at 3:11 AM, Sumner Trammell wrote:

Hi. Cocoa idioms dictate setFoo: and foo: for setters and getters.
Occasionally, the prefix "get" appears in a Cocoa method, like this
one:


- (void)getObjects:(id *)objects andKeys:(id *)keys


When a method is prefixed with get in Cocoa, what is being expressed?

From the guidelines discussed here <http://developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html >:


Use “get” only for methods that return objects and values indirectly. You should use this form for methods only when multiple items need to be returned.

Cheers, Ken_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >"get" prefixes in Cocoa (From: "Sumner Trammell" <email@hidden>)

  • Prev by Date: Re: Checking for hackintosh
  • Next by Date: How to include reusable headers in Frameworks
  • Previous by thread: Re: "get" prefixes in Cocoa
  • Next by thread: Is the WebView inspector buggy in Interface Builder 3.0?
  • Index(es):
    • Date
    • Thread