• 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: init returns nil or raises exception?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: init returns nil or raises exception?


  • Subject: Re: init returns nil or raises exception?
  • From: Matt Neuburg <email@hidden>
  • Date: Sat, 09 Oct 2010 11:05:38 -0700
  • Thread-topic: init returns nil or raises exception?

On Fri, 8 Oct 2010 00:57:01 -0700, Kyle Sluder <email@hidden>
said:
>
>- (id)init {
>  if (!(self = [super init]))
>    return nil;
>
>  // do other initialization
>
>  return self;
>}
>
>To my brain, it might as well be required syntax.

Apple has signaled that the canonical form is now in fact:

- (id) init {
  self = [super init];
  if (self) {
    // do other initialization
  {
  return self;
}

m.

--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings


_______________________________________________

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

  • Prev by Date: Re: confused about floats
  • Next by Date: Re: [iOS] NSUserDefaults-backed Properties
  • Previous by thread: Re: init returns nil or raises exception?
  • Next by thread: coreData fetch ok in Sim but nil on device
  • Index(es):
    • Date
    • Thread