0

I'm opening a default address book contact in my app, but it's opening all the detail of the contact. I only want the phone number, not the other details. How do I do this?

Below is the code I use.

ABPersonViewController *personController = [[ABPersonViewController alloc] init];

personController.personViewDelegate = self;
personController.allowsEditing = NO;

personController.displayedPerson = person;
personController.addressBook = ABAddressBookCreate();

personController.displayedProperties = [NSArray arrayWithObjects:           [NSNumber numberWithInt:kABPersonPhoneProperty],                                            nil];   

[[self navigationController] pushViewController:personController animated:YES];
jrturton
  • 118,105
  • 32
  • 252
  • 268
user1072740
  • 660
  • 1
  • 6
  • 10
  • I already give this answer please check this link Click [Here](http://stackoverflow.com/questions/8229901/how-to-get-contacts-in-to-our-native-application-from-addressbook/8519706#8519706) – Hardik Shah Dec 22 '11 at 09:39
  • actually i just want to show it in default address book, I dont have to display in manually. So for that we have to pass properties, but its not working. – user1072740 Dec 22 '11 at 09:43
  • In default address book of the iPhone there is no such option to display number instead of name. I think you have to try it manually. – Hardik Shah Dec 22 '11 at 10:07

1 Answers1

0
ABContact *contact = [collection objectAtIndex:indexPath.row];
cell.textLabel.text = contact.contactName;
cell.detailTextLabel.text=contact.phonenumbers;

i used abcontactshelper class for this.