Why do we have to do [MyClass class] in Objective-C?

后端 未结 8 1605
一向
一向 2020-12-13 00:01

In Objective-C, you can invoke class methods with:

[MyClass aClassMethod];

And you can query an instance\'s kind with:

[som         


        
8条回答
  •  不思量自难忘°
    2020-12-13 00:24

    I'm thinking that MyClass is actually a meta-class. You send it the class message to get the actual class (of type Class).

提交回复
热议问题