Re: Handling errors in -initWithCoder:
Re: Handling errors in -initWithCoder:
- Subject: Re: Handling errors in -initWithCoder:
- From: "Sean McBride" <email@hidden>
- Date: Fri, 13 Mar 2009 16:21:46 -0400
- Organization: Rogue Research Inc.
On 3/13/09 3:05 PM, Graham Cox said:
>One of my classes can sometimes fail in -initWithCoder: - it relies on
>certain resources being available and if it doesn't get them, I
>thought I could follow the same pattern as -init and autorelease self
>and return nil.
Actually, I don't think that's the right pattern for failure in init.
You should call [super dealloc] not [self autorelease]. See:
<http://lists.apple.com/archives/objc-language/2008/Sep/msg00133.html>
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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