NSObject的alloc方法當(dāng)然在NSObject的meta class里面去找。但是 alloc 之后返回的是一個(gè)實(shí)例變量,此時(shí)的isa指向的就是__NSPlaceholderArray這個(gè)類叛拷。
+ (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類型來表示的绘趋,它實(shí)際是一個(gè)指向objc_class結(jié)構(gòu)體的指針闭翩。它的定義如下 objc_class結(jié)構(gòu)體定義如下: 在這...