• 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: Best practice question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best practice question


  • Subject: Re: Best practice question
  • From: Dado Colussi <email@hidden>
  • Date: Sat, 28 Oct 2006 10:57:34 +0200

http://wilshipley.com/blog/2005/07/self-stupid-init.html


On Oct 28, 2006, at 09:34, Chris Suter wrote:

I think that's broken if the super class happens to change self to another object, which whilst rare, is possible I believe.

- Chris

On 28/10/2006, at 4:59 PM, Diederik Hoogenboom wrote:

I always felt a bit awkward to reassign self so I use the following:

- (id)init
{
	if (self != [super init])
		return nil;	

	// do stuff

       return self;
}

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Best practice question (From: "Alan Smith" <email@hidden>)
 >Re: Best practice question (From: "Shawn Erickson" <email@hidden>)
 >Re: Best practice question (From: j o a r <email@hidden>)
 >Re: Best practice question (From: Chris Suter <email@hidden>)
 >Re: Best practice question (From: Diederik Hoogenboom <email@hidden>)
 >Re: Best practice question (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Best practice question
  • Next by Date: Re: sort, cut and paste
  • Previous by thread: Re: Best practice question
  • Next by thread: Re: Best practice question
  • Index(es):
    • Date
    • Thread