What is the difference between class and instance methods?

后端 未结 18 2162
说谎
说谎 2020-11-21 11:55

What\'s the difference between a class method and an instance method?

Are instance methods the accessors (getters and setters) while class methods are pretty much ev

18条回答
  •  渐次进展
    2020-11-21 12:33

    An update to the above answers, I agree instance methods use an instance of a class, whereas a class method can be used with just the class name.

    There is NO more any difference between instance method & class method after automatic reference counting came to existence in Objective-C.

    For Example[NS StringWithformat:..] a class method & [[NSString alloc] initwihtformat:..] an instance method, both are same after ARC

提交回复
热议问题