使用Objective c在后台调用类方法

ite*_*ian 12 iphone objective-c ios performselector

在下面的摘录中,

/*A ClassName with instanceMethod and ClassMethod  */

-(void)instanceMethod;

+(void)ClassMethod;

/*To call a instance method in background */

ClassName  class1obj = [ClassName alloc] init];

[class1obj performSelectorInBackground:@selector(instanceMethod) withObject:nil];
Run Code Online (Sandbox Code Playgroud)

同样,如何使用后台调用ClassMethod performSelectorInBackground

如果可能,请解释!请伙计们携手..

Ola*_*ane 18

打电话吧

[ClassName performSelectorInBackground:@selector(ClassMethod) withObject:nil];
Run Code Online (Sandbox Code Playgroud)

因为类本身就是对象,所以这将起作用.