Re: On self = [super init...] ...
Re: On self = [super init...] ...
- Subject: Re: On self = [super init...] ...
- From: Bill Bumgarner <email@hidden>
- Date: Thu, 18 Nov 2010 13:16:57 -0800
On Nov 18, 2010, at 1:10 PM, John Engelhart wrote:
> The basic premise behind self = [super init...] is that the "lower levels of initialization are free to return a different object than the one passed in".
>
> However, there is an unstated assumption in this reasoning: whatever object is returned by [super init...] is the one that will be used.
I don't understand the above claim; Why must the object returned by [super init*] be the one that is used?
I'm certainly not aware of any limitation on an init method that would prevent it from… say… calling [super init], releasing whatever is returned if deemed unfit and then allocating an initializing some other instance.
The documentation (http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/ObjectiveC/Articles/ocAllocInit.html) doesn't seem to make any such claim either.
I haven't read beyond the above yet. Maybe the unstated assumption is explained?
b.bum
_______________________________________________
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