Re: self = [super init] debate.
Re: self = [super init] debate.
- Subject: Re: self = [super init] debate.
- From: Jens Alfke <email@hidden>
- Date: Mon, 11 Feb 2008 08:08:13 -0800
On 11 Feb '08, at 1:27 AM, Jean-Daniel Dupas wrote:
I disagree with this example. I think, it's the super class
responsability to release self.
Correct. Otherwise creating an instance of the superclass would leak
memory.
The idiom for indicating failure in an -init method (without raising
an exception) is:
if( ! [self setupSomethingCritical] ) {
[self release];
return nil;
}
—Jens_______________________________________________
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