1

I just want to retrieve all Address book contacts and display that in UITableView.

Display that all contacts as shown in image.

I don't know how to do this.

enter image description here

Please suggest me to solve this problem.

Thanks in advance...

Mehul Mistri
  • 15,037
  • 14
  • 70
  • 94

3 Answers3

2

Your frined is ABAddressBook: http://developer.apple.com/library/mac/#documentation/UserExperience/Reference/AddressBook/Classes/ABAddressBook_Class/Reference/Reference.html It has (NSArray *)people that returns you all contacts. You can use that as the source for your table. I do not have complete sample code available but I think that is not the point of Stack Overflow. Search here at SO to find how to implement UITableView.

Krumelur
  • 32,180
  • 27
  • 124
  • 263
0

Here is the solution that you are looking for. In that, you will get required data from the method -(void)collectContacts.

Community
  • 1
  • 1
alloc_iNit
  • 5,173
  • 2
  • 26
  • 54
-1

Yeah, I got the solution...

Use this code

// creating the picker
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
// place the delegate of the picker to the controll
picker.peoplePickerDelegate = self;

// showing the picker
[self presentModalViewController:picker animated:NO];
// releasing
[picker release];

and It will display all contacts from iPhone as shown in figure..but not display that type of view in simulator..you have to run it in device...

Happy Coding...

Mehul Mistri
  • 15,037
  • 14
  • 70
  • 94