Skip to content
- There is no such thing as a “static context” in Objective-C. What we have instead are “class methods”. They definitely are not “static” methods.
- Class methods (ones prefixed with a
+) are really just instance methods on a particular Class object. (did your mind just explode?) And since you have a self variable accessible in an instance method, you naturally have a self variable accessible in the class method as well.
- In a class method,
self points to the class itself.
- Just as you can do
[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.
- All
Class objects are subclasses of NSObject. So you can use any NSObject instance method on any Class object. (did your mind just explode again?)
Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)