O'Reilly logo

Objective-C Memory Management Essentials by Gibson Tang, Maxim Vasilkov

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 in Swift

Swift was created to avoid some of the downsides of C, one of which being memory management. Notice that nowhere in this chapter did I mention anything about pointers, memory allocation, deallocation, and so on. This is because in Swift, memory management is made to be as painless as possible so that you, the developer, can focus more on your application development than on debugging memory leaks. Every time a new instance of a class is created, ARC will allocate a chunk of the memory to be used to store information about that instance. This chunk of memory holds information such as the instance type (string, integer, and so on) along with the values of the properties that are associated with that instance. ARC will ...

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