Avba
Avba

Reputation: 15266

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)

Upvotes: 2

Views: 1116

Answers (1)

Apurv
Apurv

Reputation: 17186

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.

Upvotes: 2

Related Questions