mac_ch5.eps
co_bar.eps

Chapter 5: Introducing Classes and Objects in Objective-C

mac_chbox5.eps

In This Chapter

Understanding objects

Designing objects

Creating classes

Using objects

Objective-C is object-oriented. Code is assembled from objects defined by class templates; instances are created and released dynamically and controlled by messages. Cocoa is a mix of object-oriented features and conventional C, blended with practical tools and techniques for creating and managing objects.

This chapter is a first look at the theory of object-oriented development in Objective-C and introduces class definitions, messaging, and constructors. The chapters that follow illustrate the practice and explain how to create links between Objective-C code and the contents of a nib file.

Understanding Objects

Objects can represent concrete data or abstract processes and relationships. Some of the advantages of an object-oriented approach include:

bl.eps Abstraction. Objects make application design simpler by hiding low-level complexity. You can concentrate on creating clean relationships between the elements in your application.

Encapsulation. ...

Get Cocoa® 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.