So, I have a UISegmentedControl with:
[control addTarget:self action:@selector(myAction) forControlEvents:UIControlEventValueChanged];
Just wondering how I would find out what segment has been selected (so I can do the appropriate action). I know its something like:
@selector(myAction:)
but what gets sent? ie: when I define my method what do I have to define?
Thank you.
get the selected item... second part of question
-(IBAction) myAction:(id)sender{
NSLog(@"myAction",nil);
UISegmentedControl * control = sender;
int selectedIndex = [control selectedSegmentIndex];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With