in objc.h , there is definition for Class
typedef struct objc_class *Class;
typedef struct objc_object {
Class isa;
} *id;
Case : use Class in NSObject :
/*************** Basic protocols ***************/
@protocol NSObject
- (BOOL)isEqual:(id)object;
- (NSUInteger)hash;
- (Class)superclass;
- (Class)class;
- (id)self;
Hard to understand, so Class is just structure, not real class like NSObject etc.
What is the real purpose of Class ?
All of the dynamic behaviors of the Objective-C runtime are available because of the
Classclass. It’s not a class that you will ever subclass or implement. The runtime fills in metadata about your class that can be accessed for introspection or modification.Languages such as C++ and even Java have very limited support for this sort of thing. Objective-C is closer to the Ruby or Python scripting languages in this regard. You can actually replace instance methods in existing classes with your own implementation at run-time and affect the class in other ways that most compiled languages just can’t touch.