• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Handling errors in -initWithCoder:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Handling errors in -initWithCoder: (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: TXT Records with NSImages
  • Next by Date: Re: NSManagedObject validateForDelete problem
  • Previous by thread: Re: Handling errors in -initWithCoder:
  • Next by thread: How to use MySql, which api is for that
  • Index(es):
    • Date
    • Thread