Q:

Block a navigation controller from navigating and ask for user confirmation

I have a UITableViewController that uses didSelectRowAtIndexPath: to init a view controller with initWithNibName:. The user is able to return to the table view but I would like to perform a if/else and display an alert view to confirm if the user would like to return to the table view. I have no clues where to start.
In short, I would like to customize the back button.

A:

Can't you create a UIBarButtonItem instance and assign it to the view controller's navigation item? Something like this,
UIBarButtonItem * backButton = [[[UIBarButtonItem alloc] initWithTitle:@"Back" 
                                                                 style:UIBarButtonItemStyleBordered
                                                                target:self
                                                                action:@selector(backButtonPressed:)] autorelease];
self.navigationItem.leftBarButtonItem = backButton;

and then in backButtonPressed:, trigger an alert view.
- (void)backButtonPressed:(id)sender {
    // Trigger an alert view.
}

Based on the user choice, you can pop the view controller or not.

