-1

I want to know in and out of memory management in iOS, pls provide me some links or Docs which are more efficient apart form apple documentations will be highly appreciated.

Thanks in Advance

satz90
  • 3
  • 7
  • you could always [look here](http://stackoverflow.com/questions/9110188/difference-between-arc-and-mrc) [on StackOverflow](http://stackoverflow.com/questions/8760431/to-arc-or-not-to-arc-what-are-the-pros-and-cons) [or possibly even via your favorite search engine](https://www.linkedin.com/groups/ARC-vs-MRC-Can-you-162305.S.173409321). – Michael Dautermann Oct 19 '14 at 08:49

1 Answers1

0

Here's a "job interview answer"-style overview of ARC versus non-ARC (or MRC, Manual Reference Counting).

When you allocate and instantiate an Objective C object, there's a retain count that's incremented. Each time another thing retains (or makes use of) that object, the retain count is incremented. In MRC, you are responsible for "retain-ing an object (so it doesn't disappear out from under you). In ARC, the compiler handles retaining the object for you.

And when you are finished with an Objective-C object, it's released. In MRC, you explicitly call "release" on that object. In ARC, the compiler releases an object for you. Releasing an object decrements the retain count.

And when the retain count reaches zero, the object is dealloc'd and freed.

I hope this makes sense to you so far.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215