CHAPTER 16

image

Defining Classes

Classes

I covered objects when I demonstrated the Objective-C objects used to work with strings, number, arrays, and dictionaries. Objects are an essential object-oriented programming pattern. While you will often simply use Foundation objects that are already set up for you, usually you will need to define your own types of objects customized for your app.

You can use classes to define your own object types. Classes are code definitions that are used to create objects. The primary purpose of coding class definitions is to express an entity that has attributes and behaviors.

Attributes are called properties when coding ...

Get Objective-C Quick Syntax Reference 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.