Are class methods convenience methods i.e. part of the framework e.g. +(id)alloc and instance methods are those that were implemented by the developer?
I can't seem to understand the difference between instance methods and class methods.
Are class methods convenience methods i.e. part of the framework e.g. +(id)alloc and instance methods are those that were implemented by the developer?
I can't seem to understand the difference between instance methods and class methods.
A class method is a message sent to the class object, whereas an instance method is a message sent to an instance of that class.
For instance:
[Dog allDogs]; // class method: ask the class Dog about its instances
[theDog bark]; // instance method: tell a specific instance of Dog to bark