• 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 init] vs. [super init] in initWithCoder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [self init] vs. [super init] in initWithCoder


  • Subject: Re: [self init] vs. [super init] in initWithCoder
  • From: Jim Correia <email@hidden>
  • Date: Sat, 19 Aug 2006 17:14:54 -0400

On Aug 19, 2006, at 12:41 PM, John McLaughlin wrote:

You bring up a good point -- In my case I use Accessorizer extensively so I never, ever, set anything except through setters so I wouldn't leak (although it is arguable less efficient since you init an object that then immediately get's deallocated)

There are caveats/considerations to using public accessor methods from -init or -dealloc. Since they are public, they can be overridden by subclasses (and will potentially have side effects even if the original methods did not.) If a subclass overrides a public accessor, and you use it from init, the subclass may not be prepared to deal with a partially constructed object. Something to consider...


Jim

_______________________________________________
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


  • Follow-Ups:
    • Re: [self init] vs. [super init] in initWithCoder
      • From: John McLaughlin <email@hidden>
References: 
 >[self init] vs. [super init] in initWithCoder (From: John McLaughlin <email@hidden>)
 >Re: [self init] vs. [super init] in initWithCoder (From: Ricky Sharp <email@hidden>)
 >Re: [self init] vs. [super init] in initWithCoder (From: John McLaughlin <email@hidden>)
 >Re: [self init] vs. [super init] in initWithCoder (From: glenn andreas <email@hidden>)
 >Re: [self init] vs. [super init] in initWithCoder (From: John McLaughlin <email@hidden>)

  • Prev by Date: Re: Re: Core Data attributes and reserved names...
  • Next by Date: Re: How do I know if a file is a symbolic link? Was: system link
  • Previous by thread: Re: [self init] vs. [super init] in initWithCoder
  • Next by thread: Re: [self init] vs. [super init] in initWithCoder
  • Index(es):
    • Date
    • Thread