The documentation doesn't say anything about that. When an old object is "removed" and a new one comes into it's place, then what happens with the old one? Do I have to release it by myself?
No, you don't have to release it by yourself.
You might get an error if the replaced object has a retain count equal to 0.
The new object is retained. The old object is released.
You do not have to release it.
You didn't perform an alloc, copy or retain on it and thus are not responsible for the memory - with this the documentation is quite clear.
I wouldn't expect Apple to document the memory management procedures for each method in the SDK unless it violates the memory management rules they have already set up. If the documentation doesn't say anything you can assume the default rules apply.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With