Re: Solving memory leaks
Re: Solving memory leaks
- Subject: Re: Solving memory leaks
- From: mmalc Crawford <email@hidden>
- Date: Sun, 28 Mar 2010 11:08:42 -0700
On Mar 28, 2010, at 11:03 am, Philip Mobley wrote:
> When calling setFields, you are then responsible for releasing the "newFields" NSMutableArray you created in your sample code, because [newFields mutableCopy] increments the ref counter.
>
This is not correct.
[newFields mutableCopy] returns a new object that you own, it does not "increment the ref count".
You must relinquish ownership of the previous value because you're about to take possession of a new value.
mmalc
_______________________________________________
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