O'Reilly logo

Cocoa® by Richard Wentk

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

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. ...

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