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

Re: Simple dealloc question


  • Subject: Re: Simple dealloc question
  • From: Andreas Mayer <email@hidden>
  • Date: Mon, 15 Oct 2007 18:42:58 +0200


Am 15.10.2007 um 11:50 Uhr schrieb Milo Bird:

Consider the following snippet:

Track *track = [someObject track];
[someObject setTrack:[[[Track alloc] init] autorelease]]; // Assuming there is a setter!
NSLog(@"%@", track); // track has been released, unless the accessor retained or copied the return value...

I'd consider this a bug in the listed code, *not* in the setter/getter.

If you need that object to stick around, you'll have to retain it yourself.


Andreas _______________________________________________

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: 
 >Simple dealloc question (From: Bob Ueland <email@hidden>)
 >Re: Simple dealloc question (From: Robert Cerny <email@hidden>)
 >Re: Simple dealloc question (From: Milo Bird <email@hidden>)
 >Re: Simple dealloc question (From: Robert Cerny <email@hidden>)
 >Re: Simple dealloc question (From: Milo Bird <email@hidden>)

  • Prev by Date: Binding NSPopupButton crashes
  • Next by Date: Re: Binding NSPopupButton crashes
  • Previous by thread: Re: Simple dealloc question
  • Next by thread: Re: Simple dealloc question
  • Index(es):
    • Date
    • Thread