O'Reilly logo

iOS Programming Cookbook by Hossam Ghareeb

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Memory management with ARC

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.

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 reaches ZERO, the object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required