In the old version of Objective-C, the objc_class structure is implemented as follows:
struct objc_class {
Class isa;
Class super_class;
const char *name;
long version;
long info;
long instance_size;
struct objc_ivar_list *ivars;
struct objc_method_list **methodLists;
struct objc_cache *cache;
struct objc_protocol_list *protocols;
};
Thus, the structure representing the object stores a pointer to the class of the object, a pointer to the superclass of the object, the name of the class of the object, version of the object, information and size of the instance, the list of variables of the instance of the object, the object is the list of methods, the cache of the object and the list of protocols of the objects. The presence of these fields in the structure representing the object is quite understandable, since each of them stores information about the object.
However, an Objective-C 2.0 implementation of the same struct objc_class looks like this:
struct objc_class {
Class isa;
};
So, in this version of objc_class, there is only one field in the structure: a pointer to an object of class struct.
, , , Objective-C 2.0, , , ?