There are 24 buttons that their labels change from a function driven by a UISegmentedControl that has 7 segments. There is also a UIPickerView with 9 different objects. These two dynamically change the labels of the buttons. Then, when a button is pressed i have to know the UIPickerView object that is selected, the UISegmentedControl selection and which button is this.
My function that receives and executes is this:
- (int)ButtonPlayController:(int)buttonPressed {
NSString *button = [NSString stringWithFormat:@"%@%i", @"button", buttonPressed];
if (button.titleLabel.text == @"1C") {
[self Play1C];
}
else if .....
}
The function receives a number (the button number) and combines the string name to create the UIButton
name, e.g. if the function receives number 8 then the UIButton
name is button8
(i already have on my .h file: IBOutlet UIButton *button8;
)
I remember these work on PHP but what about Object C? What do i have to change for this to work?