Instance Methods vs. Class Methods

Objects have three things: Identity, state, and behavior. Within that definition, types of methods (or behaviors) that can appear within an Objective-C program:

  • Instance Methods - These methods are specific to every individual object; they act on the object-specific state.
  • Class Methods - These methods can only impact the class-level state, and they cannot access object-specific state

To declare a method to be an instance method, use the minus sign (-), for example:

-(void) getLevel;

To declare a method to be a class method, use the plus sign (+), for example:

+(int)totalObjectCount;