简体   繁体   中英

Objective-C How to check which objects are referencing my object (retain cycle)

In a certain portion of code - I am expecting an object to be dellocated but it isn't.

Given that object - how can I check which objects are referencing it?

Also - Is it possible to know every time an objects reference count goes up? (and by which object)

You cant check it. Rather you should use instruments to check the same. They will show the retain count of the object. Perform the steps by running the app on instrument and check for retain count.

Even you should not use retainCount method to check. There is no way to identify that which objects are pointing to you object.

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