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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to