Hour 7. Declaring a Class in an Interface File

What You’ll Learn in This Hour

Developing classes

Introducing protocols

Looking at class declarations

Letting Xcode Do the Work

In Hour 6, “Exploring Messaging,” you saw how you use messages to tell an object (the recipient) what to do. The message itself consists of the name of a method along with zero or more arguments. At runtime, information about the receiver is used to determine what method to invoke.

That is the how of Objective-C. This hour begins an in-depth look at the what of Objective-C—the classes that are instantiated at runtime into instances or into class objects themselves. Within classes, you find the methods that are performed as a result of messages.

Designing Classes

Get Sams Teach Yourself Objective-C in 24 Hours 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.