In this recipe, we will talk about memory management in iOS using ARC (Automatic Reference Counting). ARC was first introduced in iOS 5 to help developers to manage the app memory. However, while ARC takes care of releasing objects, you still have to set up your reference types correctly to avoid any leaks and retain cycles. In the following recipe, we will try to build a simple app that has a lot of memory issues, and we will see how to catch these issues and what the correct ways to solve them are.
Memory management with ARC
Getting ready
There are some definitions and concepts about memory management that you need to know before starting our demo. In iOS, each object has a reference count in memory, and once this count...