Re: Memory management question in Objective-C 2.0 @property notation
Re: Memory management question in Objective-C 2.0 @property notation
- Subject: Re: Memory management question in Objective-C 2.0 @property notation
- From: Chris Suter <email@hidden>
- Date: Thu, 5 Feb 2009 16:20:10 +1100
Hi Kiel,
On Thu, Feb 5, 2009 at 4:10 PM, Kiel Gillard <email@hidden> wrote:
> However, doing this will yield a memory leak:
> self.name = [[NSString alloc] init];
>
> ...because the property definition tells the compiler the methods it
> synthesizes should retain the value.
You're right that it will leak in that case but you've given the wrong
reason as to why. Memory management rules are covered by Apple's
documentation.
Regards,
Chris
_______________________________________________
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