Reputation: 10159
I can't seem to get ABPersonViewController to highlight the property I want. The controller displays fine with the correct person. The phoneNumberIdentifier is a reasonable value (0 or 1 depending on the contact) and returns the correct phone number programatically.
ABPersonViewController *personViewController = [[ABPersonViewController alloc] init];
personViewController.displayedPerson = personRef;
[personViewController setHighlightedItemForProperty:kABPersonPhoneProperty withIdentifier:phoneNumberIdentifier];
personViewController.allowsEditing = YES;
[self.navigationController pushViewController:personViewController animated:YES];
[personViewController release];
Upvotes: 0
Views: 374
Reputation: 41
You must call
[personViewController setHighlightedItemForProperty:kABPersonPhoneProperty withIdentifier:phoneNumberIdentifier];
after you push the controller on the navigation controller.
And I'm afraid this is not the only peculiarity with the AddressBook framework...
Upvotes: 1