My class has an NSArray that is filled with objects. In my dealloc method, can I simply call release on my NSArray, or do I need to iterate the array and release all objects first?
Objective-c – With an NSArray of object references, do I explicitly release all objects in the array or just the array itself
iphonememory-managementobjective c
Best Answer
You can call release directly on the
NSArray
. The implementation ofNSArray
will take care of sendingrelease
to all the objects stored in the array.