Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming
by Maurice Sharp, Erica Sadun, Rod Strougo
Classes and Objects
Objects are the heart of object-oriented programming. You define objects by building classes, which act as object creation templates. In Objective-C, a class definition specifies how to build new objects that belong to the class. To create a car object, for example, you define the Car class and then use that class to create new objects on demand. As in C, implementing a class in Objective-C is done in two places: a header file and implementation file. The header file specifies how the outside world can interact with the class: the instance variables and their types, and the methods with their arguments and any return types. It is like a contract promising how instances of your class will interface with other objects. The implementation ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access