Chapter 2. Automatic Reference Counting

Good ideas live a long life and bad ones die fast. In Objective-C, reference counting's long life was seen as a very good idea. The next step of evolution in this is that it became automatic, so we call it Automatic Reference Counting (ARC), which was introduced by Apple Inc. in 2011 for application development on its desktop and mobile OS, Mac OS X Lion, and iOS 5. It changed the name of the initial referencing counting to Manual Reference Counting.

We will cover the following topics in this chapter:

  • ARC and how it works
  • Advantages and disadvantages of ARC
  • Project settings for ARC
  • Mixing code that doesn't support ARC with your project
  • Memory model in Objective C
  • ARC in UI kit