Dynamically invoke a class method in Objective C

后端 未结 4 1847
感情败类
感情败类 2020-12-08 04:09

Suppose I have Objective C interface SomeClass which has a class method called someMethod:

@interface SomeClass : NSObject {
}

         


        
4条回答
  •  庸人自扰
    2020-12-08 04:56

    You shouldn't implement this yourself.

    The NSObject Protocol has a performSelector: method that does exactly this.

提交回复
热议问题