Pointers

Pointers enable you to effectively represent complex data structures, change values passed as arguments to functions and methods, and more concisely and efficiently deal with arrays. At the end of this chapter, we also clue you in about how important they are to the implementation of objects in the Objective-C language.

We introduced the concept of a pointer in Chapter 8, “Inheritance,” when we talked about the Point and Rectangle classes and stated that you can have multiple references to the same object.

To understand the way pointers operate, you first must understand the concept of indirection. We witness this concept in our everyday life. For example, suppose that I need to buy a new toner cartridge for my printer. In the company ...

Get Programming in Objective-C, Fifth Edition 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.