That line alone does not indicate any memory leaks occurring due to over-retaining objects. You'll need to provide more context (the surrounding code, etc).

The object returned by -[NSArray objectAtIndex:] is the actual object (ie. pointer to the actual object's space in memory) stored in the array, not a copy. When you add objects to an array, as well, the object stored in the array is not a copy but the object itself.

- Bryan

On Nov 1, 2009, at 2:44:07 PM, Nava Carmon wrote:

Hi,

When I ran Build and Analyze on my code, it has pointed as a possible leak the following statement:

NSObject *anObject = [anArray objectAtIndex:i];

anObject wasn't released and here's the question: whether anObject is a copy of actual object, that is a member of anArray or it's the object itself?

Should I release it?

Thanks,
Nava
_______________________________________________

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/bryanhenry%40mac.com

This email sent to bryanhe...@mac.com

_______________________________________________

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