views:

153

answers:

2

I feel that both are the same thing, but I am not sure.

+4  A: 

Reference counting is a technique for resource management. In objective-c the retain method is used to increment the reference count so the terms reference count and retain count are interchangeable.

The Memory Management Programming Guide for Cocoa provides a good overview.

Brett Carswell
+3  A: 

Nothing, they are synonymous:

... An object has a reference count (often called a retain count) and when this reaches zero the object is sent a dealloc message, which cause it to free itself. At the simplest level, every time you want to keep a pointer to an object, you need to send it a retain message: ...

... When an app suddenly disappears from the simulator it usually means that the retain count (another name for reference count) has gone to zero, the system cleared it away but you tried to access it! When you attempt to send a message to a random bit of memory that used to be your object then - puff - you whole app just disappears....

(I'm assuming you are just talking about the name and concept retain count, not the method retain)

altCognito