hi, i have been working on a small demo and i wrote a function which accepts two string object and looks like this
-(void)adding:(NSString*)num1 :(NSString*)num2
{
num1 = first.text; //first is object of label
num2 = second.text; //second is object of label
int x= [num1 integerValue];
int y = [num2 integerValue];
int r = x+y;
NSLog(@"%d",r);
}
am having one more function
-(void)calling
{
[self performSelector:@selector(adding:)withObject:@"num1" withObject:@"num2"];
}
and am calling the method named calling on button touch up inside event
[btn addTarget:self action:@selector(calling) forControlEvents:UIControlEventTouchUpInside];
but i get an error called unrecognized selector sent to instance
can you please tell me where i am wrong and how to pass methods with arguments to selector. Thank you