If the user needs to press the button first, then pick a row, you can't use the compound if statement like you have in your question, since the row won't have been picked yet. One way to do it, would be to just have your button method set a value on an ivar (based on its tag) which you then check in didSelectRowAtIndexPath:. So, if you had an int ivar, buttonPressed, your IBAction could be:
@implementation ViewController {
int buttonPressed;
}
-(IBAction)buttonPressed:(UIButton *) sender {
buttonPressed = sender.tag;
}
Then, in the didSelectRowAtIndexPath method:
-(NSIndexPath *)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if(buttonPressed == 1) {
// do something with indexPath.row info
// perform whichever segue
}else if (buttonPressed == 2) {
// do something with indexPath.row info
// perform whichever segue
}
}