tags:

views:

10

answers:

0

Hi,

I have a simple project based off the "Navigation Based application" project type. The RootViewController has a list of rows with some names for contacts, and a button which should take them to that contact's details page with ABPersonViewController.

I have all the hooks working and I show the correct ABPersonViewController by pushing it on the navigation stack... but it doesn't have a Back button! The app gets stuck because there's no way to get back to my app. How do I enable the back button? Would appreciate some help.

Here's the relevant code:

- (void) nameButtonClicked: (id) sender
{
    UIButton *button = (UIButton *) sender;
    NSLog(@"name button clicked... record_id = %i", button.tag);
    ABRecordRef contact_data = ABAddressBookGetPersonWithRecordID(address_book, button.tag);

    ABPersonViewController *ab = [[ABPersonViewController alloc] init];
    [ab setPersonViewDelegate:self];
    [ab setDisplayedPerson:contact_data];
    ab.allowsEditing = YES;
    [self.navigationController pushViewController:ab animated:YES];
    [ab release];
}