#import <Foundation/Foundation.h>
#import "Person.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
// 获取类对象
Class c1 = [Person class];
// 使用类对象创建实例对象
Person *p = [c1 new];
[p test]; // -test 表示对象创建成功,c1当Person来用的
// 使用类对象调用方法
[c1 test]; // +test
}
return 0;
}
类对象的使用
最新推荐文章于 2024-06-24 08:56:25 发布
3789

被折叠的 条评论
为什么被折叠?



