Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

17. Connecting to the Address Book > Modifying and Viewing Individual Contacts

Modifying and Viewing Individual Contacts

The ABPersonViewController’s allowsEditing property enables your user to edit contacts. You create a controller, assign an Address Book record as its displayed-Person, set its editable property, and display it. Here’s a typical example of this feature in a callback method. Upon resolving to a particular contact, the application creates a new person presentation and pushes it onto the navigation stack.

- (void)unknownPersonViewController:
        (ABUnknownPersonViewController *)unknownPersonView
    didResolveToPerson:(ABRecordRef)person
{
    // Handle cancel events
    if (!person) return;

    ABPersonViewController *abpvc = [[ABPersonViewController alloc] init];
    abpvc.displayedPerson = person;
    abpvc.allowsEditing = YES;
    abpvc.personViewDelegate = self;

    [self.navigationController pushViewController:abpvc animated:YES];
}


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial