Thank you, that answers my question,
Nava
On Nov 1, 2009, at 10:24 PM, Sherm Pendley wrote:
On Sun, Nov 1, 2009 at 2:44 PM, Nava Carmon wrote:
NSObject *anObject = [anArray objectAtIndex:i];
...
Should I release it?
No. You didn't create anObject with +alloc or a method beginning with
-
On Sun, Nov 1, 2009 at 2:44 PM, Nava Carmon wrote:
>
> NSObject *anObject = [anArray objectAtIndex:i];
...
> Should I release it?
No. You didn't create anObject with +alloc or a method beginning with
-copy, nor did you send it a -retain message. Therefore you do not own
it and must not release it
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 t