iphoneeditabpersonviewcontroller

Directly open ABPersonViewController in EDIT MODE DIRECTLY in iphone


I am developing address book app. When user selects a user from a contact list , I want to open that record directly in EDIT mode using ABPersonViewController instead of clickng Edit button of ABPersonViewController. How can I achieve this? Thanks


Solution

  • Just call setEditing after the view is displayed:

    ABPersonViewController *ab = [[ABPersonViewController alloc] init];
    ab.allowsEditing = YES;
    // customize as you see fit
    [self.navigationController pushViewController:ab animated:YES];
    [ab setEditing:YES animated:NO];
    

    I tried this on the iPad from within a popover controller and that works fine.