The self keyword in iOS has many meanings and rules. It does not mean which class of object it refers to in which class the subject understands! First of all, correct this problem. Self represents the object of the current class. In the picture posted by the subject, the type of the current object is displayed, which can be understood as calling [self class]. If the current class and all parent classes have not overridden this method, Then the class method of NSObject will be called.
In addition, the self keyword in OC has different meanings and functions in different scopes. In instance methods, self represents the first address of the object, while in class methods, self represents the current Class. In OC, Class is also an object, so self is different,
The self keyword in iOS has many meanings and rules. It does not mean which class of object it refers to in which class the subject understands! First of all, correct this problem. Self represents the object of the current class. In the picture posted by the subject, the type of the current object is displayed, which can be understood as calling [self class]. If the current class and all parent classes have not overridden this method, Then the class method of NSObject will be called.
In addition, the self keyword in OC has different meanings and functions in different scopes. In instance methods, self represents the first address of the object, while in class methods, self represents the current Class. In OC, Class is also an object, so self is different,
When that object is really a subclass object