Why is using self allowed in static context in Objective-C?
I thought it was allowed and then I encountered memory errors that took me a week to find out that self is not an alias for calling other static methods from the class instead of typing the class name.
Xcode and its compiler seems very smart at finding common pitfalls, why isn’t it even generating a warning about something like that?
+) are really just instance methods on a particularClassobject. (did your mind just explode?) And since you have aselfvariable accessible in an instance method, you naturally have aselfvariable accessible in the class method as well.selfpoints to the class itself.[self performAction]inside an instance method to invoke methods on this particular instance, you can do[self performClassAction]inside a class method to invoke methods on this particular class.Classobjects are subclasses ofNSObject. So you can use anyNSObjectinstance method on anyClassobject. (did your mind just explode again?)