i'm working on app for iphone on objective-c i have array with object references If i remove item with object reference from array should i release this object additionally or it will be removed from memory automatically?
3 Answers
If the NSArray (um, it is an NSArray, isn't it? C arrays provide no ownership management) is the only thing that owns the object -- that is, if the object added was acquired autorelease-d or you explicitly called release after adding -- then it will be cleaned up automatically on removal. Any other ownership claims will still need to be release-d as normal.