NSObject的alloc方法當然在NSObject的meta class里面去找糖赔。但是 alloc 之后返回的是一個實例變量茶宵,此時的isa指向的就是__NSPlaceholderArray這個類染乌。
+ (instancetype)alloc OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
In the case of NSArray, when an instance is allocated, it’s an instance of another class that’s allocated (during a call to alloc), known as a placeholder array. This placeholder array is then converted to an instance of another class, which is a concrete subclass of NSArray. -《Effective Objective-C 2.0》
iOS Runtime:Class 和 meta-class1、Class Objective-C類是由Class類型來表示的栓撞,它實際是一個指向objc_class結構體的指針。它的定義如下 objc_class結構體定義如下: 在這...