Does NSMutableArray -removeLastObject create a RELEASE object?
Yes Yes. Any remove triggers the release of the remote NSObject
.
The link NSArray
indicates:
Arrays maintain strong references to their contents - in the managed memory environment, each object receives a save message before adding its id to the array and release message when it is removed from the array or when the array is freed. if you want a collection with different object property semantics, consider using a CFArray, NSPointerArray, or NSHashTable reference instead.
source to share
Yes, they are released. You can see that the contained object is freed by overriding release
in the object you placed in the container. Call the superclass method release
and set a breakpoint on it. You will see that it has been released.
I initially stated that I thought the objects were automatically released. It turns out that I believe I am wrong.
source to share