Class type Objective C

后端 未结 2 1659
自闭症患者
自闭症患者 2021-02-09 03:03

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:36

    It is now

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

    object_getClassName instead of class_getClassName

提交回复
热议问题