我很关心楼主这么做的目的
+(Class)class;是静态方法,不用实例化。 比如直接[UIViewController class]就行了。
在objC中还真有一个类方法class,可以得到当前实例变量的类型。 define: +(Class)class; example: UIViewController *vc=[[UIViewController alloc] init]; NSLog(@"vc type is :%@",[vc class]);
+(Class)class;
UIViewController *vc=[[UIViewController alloc] init]; NSLog(@"vc type is :%@",[vc class]);
29,028
社区成员
12,466
社区内容
加载中
试试用AI创作助手写篇文章吧