I have a ViewController with a UIPickerView loaded from a NSMutableArray. I also have a UIBarButtonItem for an IBAction. What I would like to do is have the IBAction do different things, depending on what is selected in the UIPickerView. I first tried this:
This doesn't change anything, and will only pull displayComposerSheet, and none of the others. If I try to change the if statement to:
I am informed that row has not been declared, though I set it up using NSInteger and void methods earlier. How can I get this one button to perform different actions based on what the uipickerview shows?
Code:
-(IBAction)compose {
if ([options objectAtIndex:0]) {
[self displayComposerSheet];
}
if ([options objectAtIndex:1]) {
[self displayComposerSheet2];
}
if ([options objectAtIndex:2]) {
[self displayComposerSheet3];
}
}
Code:
if ([options objectAtIndex:row])