I alloc my NSMutableArray, and add objects that were alloced as well. Will calling release on my array also release the elements within, or do I have to release each element manually first?
I alloc my NSMutableArray , and add objects that were alloced as well. Will
Share
Objects in obj-c collection are released when that collection is deallocated (that’s not the same as being released). So in practice if you add your object in collection, collection manages its objects ownership and you don’t need to put extra releases for its elements.