December 2013
Intermediate to advanced
132 pages
1h 58m
English
CHAPTER 17
![]()
Class Methods
Class Methods Defined
In Chapter 16, we described how to define classes with properties and methods. The type of method we focused on was instance methods. Instance methods are methods can only be used with objects. When you want to use an instance method, you send a message to an object.
For instance, if you want to send the generateReport message to a Project object, you first need create the object and then send the message right to the object.
Project *p = [[Project alloc] init];[p generateReport];
Class methods are like instance methods except that they can only be used with classes. When you want to use a class method, ...
Read now
Unlock full access