简体   繁体   中英

retaincount of ViewController +4 when pushed by NavigationController

I was wondering why the retainCount of a viewController is raised by 4 when pushed onto the stack of a Navigationcontroller eg 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM