Chapter     3

Objects and Messaging

Now that you have a good understanding of how to create classes using Objective-C, you may be wondering, “How do I use these classes?” That’s the focus of this chapter; specifically object creation, initialization, and invoking methods on objects using Objective-C.

As you learned in Chapter 2, an Objective-C class is defined by its instance variables, properties, and methods. In addition, through OOP inheritance, a class also contains the state and behavior (i.e., methods and instance variables) of its parent class/classes. At runtime, an object-oriented program executes its logic by creating objects and invoking the desired operations on these objects using messaging—an OOP mechanism for invoking methods ...

Get Pro Objective-C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.