O'Reilly logo

Objective-C Fundamentals by Collin Ruffenach, Johannes Fahrenkrug, Christopher K. Fairbairn

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

Chapter 5. Creating classes

 

This chapter covers
  • Creating custom Objective-C classes
  • Adding instance variables
  • Adding class and instance methods
  • Adding properties
  • Implementing init and dealloc

 

The real power of object-oriented programming comes into play when you start to create your own custom objects that perform application-specific tasks, and this is what we explore in this chapter. By creating a custom class, you can encapsulate a common set of functionality into a reusable component that you can use repeatedly throughout an application (or even a set of applications).

To put the concepts into context, we concentrate on updating the Rental Manager application to use object-oriented design principles, replacing the Rental-Property ...

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