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

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


  • Subject: Re: Re: [self init] vs. [super init] in initWithCoder
  • From: "Shawn Erickson" <email@hidden>
  • Date: Fri, 18 Aug 2006 14:12:26 -0700

On 8/18/06, glenn andreas <email@hidden> wrote:

If you make a subclass of Foo and in your initWithCoder call [self
init], that would end up allocating dict (in -[Foo init]), and then
[super initWithCoder:] will decode another dictionary, leaking the
old one.

Of course if you used a setter to set your dictionary (or capabilities of Objective-C v2) you wouldn't have to worry about that type of mistake. ;)

-Shawn
_______________________________________________
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: 
 >[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>)

  • Prev by Date: Re: What's the fastest way to get icons for file/folders?
  • Next by Date: Re: Where to properly call [NSPersistentStoreCoordinator persistentStores] ?
  • 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