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

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

    Because what the isKindOfClass expects is a "class" and that's what get returned from invoking: [MyClass class]

提交回复
热议问题