- 使用KVC
[obj valueForKey:@"retainCount"]
- 使用CFGetRetainCount
CFGetRetainCount((__bridge CFTypeRef)(obj))
- 使用私有API
OBJC_EXTERN int _objc_rootRetainCount(id);
_objc_rootRetainCount(obj)
[obj valueForKey:@"retainCount"]
CFGetRetainCount((__bridge CFTypeRef)(obj))
OBJC_EXTERN int _objc_rootRetainCount(id);
_objc_rootRetainCount(obj)