Possible Duplicate:
Objective-C: Class vs Instance Methods?
Why we put '+' or '-' sign in front of method name in iOS. Please help me on sign logic and what's the difference in that ?
Possible Duplicate:
Objective-C: Class vs Instance Methods?
Why we put '+' or '-' sign in front of method name in iOS. Please help me on sign logic and what's the difference in that ?
It has nothing to do with signs;
+ means the method is a class method, that is, it operates on (or, rather, its scope is) the class itself, not instances. The corresponding thing in many other languages is static.
- means the method is an instance method, that is, it operates on instances of the class.
`@interface MyClass : NSObject
{
}
+(id) someMethod; // declaration of class method
-(id) someMethod; // declaration of instance method
@end`
Instance methods apply on instances of classes, so they need an object to be applied on and can access their caller's members.
On the other hand class methods apply on the whole class, they don't rely on any object.
check this link for proper knowledge link
A minus - sign denotes an instance method. A plus + sign is a class method.
The leading + sign denotes a class method, the - sign means an instance method.
Side note: this should not be asked here - read that tutorial more carefully.