Reputation: 1721
I have three methods which are taking parameters,
I am taking exception at this parameter giving,
[QuestionnaireView continueSingle:withQuestion:question:]: unrecognized selector sent to instance 0x8a4b1c0
What am i doing wrong? Its definition is also given in the header file.
Here is my code;
-(void) continueSingle:(id)sender withQuestion:(Question*)quest{
int counter = 0;
NSString * tempAnswer;
for(UIView* subview in [sender superview].subviews)
{
if([subview isKindOfClass:[UIButton class]])
{
if([((UIButton*)subview) isSelected])
{
counter++;
tempAnswer = [NSString stringWithFormat:@"%@",((UIButton*)subview).currentTitle];
}
}
}
}
Upvotes: 0
Views: 66
Reputation: 17535
Your mistake is here
-(void) continueSingle:(id)sender withQuestion:(Question*)quest
Because you are passing three parameter but you're receiving only two parameter. So you need to take 3 parameter. Like this..
-(void) continueSingle:(id)sender withQuestion:(Question*)quest question:(Question *)question1
Upvotes: 1