retainCount
is taboo, unreliable, unpredictable, and in general shouldn\'t be used. I don\'t use it anywhere in my code, but I have se
Nope. You're relying on an abstracted implementation which publicly bears the sign "Keep Out" on its gate.
Just manage your dependencies using your own memory and implementation. This might include an ivar and/or methods for completion/destruction phases.
See also the documentation for release
:
release
Decrements the receiver’s reference count. (required)
- (oneway void)release
Discussion
The receiver is sent a dealloc message when its reference count reaches 0.
You would only implement this method to define your own reference-counting scheme. Such implementations should not invoke the inherited method; that is, they should not include a release message to super.
If you want to be sure your program behaves correctly across multiple releases, it's best to change it now.