Class type Objective C

后端 未结 2 916
无人共我
无人共我 2021-02-09 02:53

In the NSObject protocol, it defines a method that is similar to this:

-(Class) class

What type of object is the Class object? Or

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-09 03:33

    It is now

    NSObject *o = [[NSObject alloc]init];
    NSLog(@"%s\n", object_getClassName([o class]));

    object_getClassName instead of class_getClassName

提交回复
热议问题