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

What is an object within Objective-C?

How do things work inside Objective-C? NSObject is the root class of most Objective-C class hierarchies, through it an object inherits basic methods and behaves like an Objective-C object.

This object is an instance of a class and can also be a member of a class or one of its derivatives. So, let's take a deeper look at NSObject. In the early stage, Objective-C had a class called Object. This had a method called +new, which wrapped malloc(), and a method called -free. Since Objective-C objects were generally aliased and managing object life cycles became quite complex, this was troublesome.

NSObject is used by NeXT—Steve Job's second company, founded after he was fired from Apple in 1985—in order to provide ...

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