Hi guys,
Feeling a little confused. I am trying to pass a NSString as an argument to this method
-(void) setRightLabelText:(NSString *)text { rightLabel.text = text; }
The code i use to call the method
for(int index=0; index<5; index++)
{
NSNumber *num = [card.statsArray objectAtIndex:index];
StatView *statView = (StatView *)[self.frontView viewWithTag:10+index];
NSString *nameHolder = @"test";
[statView setRightLabelText:nameHolder];
}
The code I used to create the View :
for(int i=0; i<totalButtons; i++)
{
StatView *sv = [[StatView alloc] initWithYPos:ypos];
sv.tag = 100 + i;
[sv.overlayButton addTarget:self action:@selector(statTapped:)
forControlEvents:UIControlEventTouchUpInside];
sv.overlayButton.tag = 10 + i;
[self.frontView addSubview:sv];
ypos += 26;
}
This to me looks perfect, but i get a crash when I get to this method call in the app. Error Msg : -[UIButton setRightLabelText:]: unrecognized selector sent to instance 0x5d116e0 2010-09-13 11:39:44.761 LeinsterRugby[1387:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIButton setRightLabelText:]: unrecognized selector sent to instance 0x5d116e0'