O'Reilly logo

Mac Programming for Absolute Beginners by Wallace Wang

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 12. Creating Classes and Objects

In the previous chapters when you were working with strings (NSString), arrays (NSArray), dictionaries (NSDictionary), and sets (NSSet), you were working with predefined classes that Apple's programmers have already created. Although it's entirely possible to write fairly sophisticated programs using the predefined classes stored in the Cocoa framework, chances are good you'll need to create custom classes for your own programs, which means you need to know how to create your own classes.

A class defines the properties (data) and subprograms (methods) that work together in isolation from the rest of your program. The basic idea behind a class is to act as a modular building block to create a larger program. ...

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