Q:

How to find the reference count of an object

I want to know the reference count of an object in my program. Can I?

A:

Sure:
int referenceCount = rand();

The real answer, of course, is the retainCount method; NSUInteger rC = [someObject retainCount];.   However, the value returned by it is useless.

never never use the retain count in a conditional
the retain count can never be zero
the retain count never reflects whether or not the object is autoreleased
a retain count of 2-bazillion is perfectly reasonable for some classes some of the time
the retain count for any object that passes through system API may be a seemingly random value within indicating a problem

Bottom line:  If you treat the retain count as an absolute value, you are doing it wrong.   You either increase or decrease the retain count through your code,  Keep your plusses and minuses in balance, and you are doing it right.

