我不断收到错误实例方法未找到执行选择器...任何人都可以帮助我清除此错误吗?
#import <Foundation/Foundation.h>
#import "add.h"
int main(int argc, const char * argv[])
{
SEL mySelector;
id b = [[add alloc] init];
mySelector = @selector(add2Num:);
[b performSelector: mySelector]; // here is where i am getting the error
[b release];
return 0;
}
然后 int add.m 文件
#import "add.h"
@implementation add
-(void)add2Num
{
num1 = 1;
num2 = 2;
iResult = num1+ num2;
}
@end
提前感谢您的帮助。