Re: why does this method return an id?
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