#import <Foundation/Foundation.h>
#import "Dog.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
Dog *d = [Dog new];
[d test]; // 对象方法
[Dog test]; // 调用类方法
Dog *d1 = [Dog new];
// 类对象的获取方法
// 类对象属于Class类型
// 1. 通过实例对象来获取
Class c1 = [d class];
Class c2 = [d1 class];
NSLog(@"%p", c1);
NSLog(@"%p", c2);
// 2. 通过类名名来获取对象
Class c3 = [Dog class];
NSLog(@"%p", c3);
}
return 0;
}