Answer the question
In order to leave comments, you need to log in
What is the difference between a class method and an object method in Objective-C?
Hello, please explain what is the difference between a class method and an object method in Objective-C?
Why is such a division necessary? How and where is it used?
I just used only C++ and Java before. So I have a pattern break :-D. I read the literature, but I didn't fully understand it anywhere.
Answer the question
In order to leave comments, you need to log in
Well, since they used C++ before, they probably met with static methods. Here they can be considered analogues of class methods. Non-static methods, respectively, are analogous to object methods. Roughly speaking, a class method can be used without creating an instance of that class.
Static method - performs some actions, but cannot affect the properties of the ksass. Dynamic - can only be called when an instance of the class (object) is created, but it can access the properties of the object.
In general, in order not to explain for a long time - first read the basics of OOP, they are almost the same for all PLs, for example:
habrahabr.ru/post/87119
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question