Class methods can not write the book for instance, but I do not see every instance of a class method is invoked handled Well, what can distinguish the difference between class and instance methods it? I am a novice, please advise! !
Reply:
+ (Void) method name / / class method declaration
- (Void) method name / / instance method declaration
As used to instantiate an instance method is to use, and the other not. I do not have much of this explanation.
Reply:
Preceded by "+" sign is a class method, "-" sign is an instance method.
Reply:
Preceded by "+" sign is a class method, you can be understood as static, as long as the definition, and it occupies a space in the program, "-" sign is an instance method, this is the need to create an instance object instance is the need to call The.
Reply:
With a "+" is a class method is called directly using the class name. With "-" is the strength of the method, you need to instantiate an object to invoke.
Reply:
Upstairs said right
No comments:
Post a Comment