i have a slider which i create programmatically
UISlider *mySlider = [[UISlider alloc] initWithFrame:CGRectMake(30,mainCategory.frame.size.height+subCategory.frame.size.height+questionLabel.frame.size.height +offsetQuestion,433,38)];
[mySlider addTarget:self action:@selector(sliderAction::) forControlEvents:UIControlEventValueChanged];
[mySlider setBackgroundColor:[UIColor clearColor]];
mySlider.minimumValue = 0;
mySlider.maximumValue = 100;
mySlider.continuous = YES;
mySlider.value = 0;
but i need to send questionID parameter to sliderAction method and here is the sliderAction method:
-(void)sliderAction:(int)questionID :(id)sender
{
int discreteValue = roundl([(UISlider*)sender value]);
UILabel *mylabel = (UILabel *)[self.scrlview.superview viewWithTag:questionID];
mylabel.text=[NSString stringWithFormat:@"%d",discreteValue];
NSLog(@"%d",[sender tag]);
}
i don't know how to call it with questionID