标签:ref instance .class 难点 bsp getc 指针 control log
http://www.cnblogs.com/feng9exe/p/7232915.html
Note: 其实这里的难点就在于对 和 的区分。
ViewController: 0x10deee650, ViewController, 0
ViewController: 0x10deee678, NSObject, 1
NSObject: 0x10ef8cee8, NSObject, 1
NSObject: 0x10ef8cee8, NSObject, 1
ViewController
UIViewController
UIResponder
NSObject
ViewController: 0x10deee650, ViewController, 0
ViewController: 0x10deee650, ViewController, 0
Class currentClass = object_getClass(self);
Class nextClass = object_getClass(currentClass);
Class superClass = class_getSuperclass(currentClass);
Class xClass = self.class;
int k = 0;
do {
NSLog(@"%@:\t%p,\t%s,\t%zd",NSStringFromClass(currentClass),currentClass,object_getClassName(currentClass),class_isMetaClass(currentClass));
currentClass = nextClass;
nextClass = object_getClass(currentClass);
}while (k++ < 4);
NSLog(NSStringFromClass(self.class));
while (superClass != NULL) {
NSLog(NSStringFromClass(superClass));
superClass = class_getSuperclass(superClass);
}
k = 0;
do {
NSLog(@"%@:\t%p,\t%s,\t%zd",NSStringFromClass(xClass),xClass,object_getClassName(xClass),class_isMetaClass(xClass));
xClass = xClass.class;
//nextClass = object_getClass(currentClass);
}while (k++ < 3);
isa class superclass metaclass
标签:ref instance .class 难点 bsp getc 指针 control log
原文地址:https://www.cnblogs.com/feng9exe/p/10384535.html