While using ARC, life is much easier in terms of memory management; but, let's say I wish to look at a certain object while the app is running and see how many pointers are pointing to it at each certain point in the code. Is there a way to do that?
Asked
Active
Viewed 82 times
0
-
1It's not recommended to relay on retain count in any way. – βhargavḯ Jul 24 '13 at 11:39
-
1http://stackoverflow.com/questions/12262403/find-where-object-is-retained-with-arc hope this help you – iTag Jul 24 '13 at 11:47
1 Answers
3
You can access the retain count using -retainCount
or CFGetRetainCount
but it will almost never give you any meaningful or useful information. Objects can be added to autorelease pools, retained by the various internals of the objective-c runtime or Apple frameworks, ARC, etc. You shouldn't really care how many people have retained an object, only whether you need a strong reference to it at any point in time.
Relevant link: whentouseretaincount.com

Mike Weller
- 45,401
- 15
- 131
- 151