在下面這段摘錄代碼中:
/*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];
怎麼用performSelectorInBackground
在背景中調用ClassMethod?
類本身就是對象,所以只要調用:
[ClassName performSelectorInBackground:@selector(ClassMethod) withObject:nil];
應該就可以