我想在Functions.h
中使用另一个h文件中的函数。
我试过了:
#import "Functions.h"
....
Functions *Func = [[Functions alloc]init];
[self performSelectorInBackground:@selector(?????????) withObject:nil];
甚至可能吗?
答案 0 :(得分:1)
如果方法是实例方法,
Functions *func = [[Functions alloc] init];
[func performSelectorInBackground:@selector(theMethodToRunInBackground) withObject:nil];
如果它们是类方法,
[Functions performSelectorInBackground:@selector(theMethodToRunInBackground) withObject:nil];
答案 1 :(得分:0)
您应该使用Func
代替self
[Func performSelectorInBackground:@selector(function) withObject:nil];