Memory Management in Objective C: Manual Retain Release (MMR) vs Automatic Reference Count (ARC)

iPhone Development Answers

In Objective-C control on a object is done by reference counting. Reference counting basically increases the count by the number of ownerships an object has by one each time. So when the object has only single ownership reference count will be and so on.

So if the reference count is greater than 1 it means the object exists but as soon as it reached zero the Operating system will destroy the object.

As a language Objective-C doesn’t have a garbage collector. Before in older versions of Xcode i.e. 4.2 the developer had to maintain the object reference counts and release the counts as they are not needed along the application. This concept is called Manual Retain Release (MRR). The main problem that the developers faced with MRR was there more times was getting consumed in taking care of objects memory rather than developing the App.

So from Xcode 4.2…

View original post 42 mots de plus

Publicités
Par défaut