• 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: why does this method return an id?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why does this method return an id?


  • Subject: Re: why does this method return an id?
  • From: Joar Wingfors <email@hidden>
  • Date: Tue, 13 Dec 2011 00:33:06 -0800

On 12 dec 2011, at 22:39, Matt Neuburg wrote:

> Also, if that's the right answer (i.e. if it's all about subclassing), then I don't get why *every* convenience constructor isn't typed as an id.


The general rule across Cocoa is that initializers and factory methods return id typed objects (ie. -[NSArray initWithArray:], +[NSArray arrayWithArray:]), while shared instances returns explicitly typed objects (ie. +[NSProcessInfo processInfo]).

Joar


_______________________________________________

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: 
 >Re: why does this method return an id? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: why does this method return an id?
  • Next by Date: Re: why does this method return an id?
  • Previous by thread: Re: why does this method return an id?
  • Next by thread: Re: why does this method return an id?
  • Index(es):
    • Date
    • Thread