Breaking News
Home / iOS / ObjectiveC / How to get Retain Count of an Object in ObjectiveC?

How to get Retain Count of an Object in ObjectiveC?

Retain count helps to tell how many objects are holding this object. Simply sent the retainCount message to the object as show below.

print  (int)[theObject retainCount]

The release keyword reduces the retain count by 1.Remember the object gets destroyed by Run time when the retain count goes to 0.

[pb_builder]

Check Also

Singleton Example in Objective C?

Solution static MyManager *sharedManager = nil; +(MyManager*) sharedManager {         if (sharedManager == nil)         …

Advertisment ad adsense adlogger