开发者

retaincount of ViewController +4 when pushed by NavigationController

开发者 https://www.devze.com 2023-01-22 07:56 出处:网络
I was wondering why the reta开发者_StackOverflow中文版inCount of a viewController is raised by 4 when pushed onto the stack of a Navigationcontroller e.g. from a tableView. What dependencies are creat

I was wondering why the reta开发者_StackOverflow中文版inCount of a viewController is raised by 4 when pushed onto the stack of a Navigationcontroller e.g. from a tableView. What dependencies are created?


The retainCount method of the NSObject Protocol shouldn't be used for anything really. In fact, the documentation for this method says this:

This method is typically of no value in debugging memory management issues. Because any number of framework objects may have retained an object in order to hold references to it, while at the same time autorelease pools may be holding any number of deferred releases on an object, it is very unlikely that you can get useful information from this method.

If you are having memory management issues, make sure you've read the Memory Management Rules.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号