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

后端 未结 8 1593
一向
一向 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:42

    My first glance answer is because [MyClass class] return a object of type Class, and MyClass doesn't inherit from Class...

提交回复
热议问题