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 18:37:07 -0800
On Nov 18, 2010, at 2:34 PM, John Engelhart wrote:
> method is just going to -dealloc my object and do something else (you know, basically exactly what I'm trying to do with my own object substitution, hint hint), then what's the point in even trying to do object substitution in the first place?
The documentation says:
In general, if there is a problem during an initialization method, you should call [self release]and return nil.
Thus, no, there is no problem if multiple classes in the hierarchy participate. The only stumbling point is that this:
self = [super init];
May cause 'self' to be released; if you have code that is still referring to self via some other means, it better had darned well retained it before making that call.
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