• 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: self = [super init] debate.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >self = [super init] debate. (From: Scott Andrew <email@hidden>)
 >Re: self = [super init] debate. (From: Scott Andrew <email@hidden>)
 >Re: self = [super init] debate. (From: Adhamh Findlay <email@hidden>)
 >Re: self = [super init] debate. (From: John Newlin <email@hidden>)
 >Re: self = [super init] debate. (From: Wade Tregaskis <email@hidden>)
 >Re: self = [super init] debate. (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Logging Mechanisms in Cocoa
  • Next by Date: Re: split up alloc and init?
  • Previous by thread: Re: self = [super init] debate.
  • Next by thread: Re: self = [super init] debate.
  • Index(es):
    • Date
    • Thread