Re: Simple dealloc question
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