Objects and Classes

Just like in Java, Objective-C uses a concept of classes that describe a real-world phenomenon, such as a Customer, a Book, or an Account. Classes are written in code and form the blueprint for instantiation of multiple objects from the same class. Each object is then a representation of a single real-world instance from the class. For instance, if you were to write an application to keep track of all the books you own, you would likely instantiate an object for every one of those books.

For the examples in the rest of this chapter, create a project in Xcode (File > New > Project). Use the Single View Application template under iOS Application. Name the product Objective-C Examples, and limit Devices to just target iPhone. ...

Get Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android 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.