0

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];
David Beck
  • 10,099
  • 5
  • 51
  • 88

1 Answers1

1

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...

Alexis B.
  • 41
  • 1
  • 3