displaying contacts in a UItableview
i am able to add contacts (iphone contacts ) to a table view all at once by clicking ref开发者_开发知识库resh button in my application . But i want to add specific contacts to my table view that mean (when i select a contact in the people picker view controller only that contact has to add in my table view can any one please help me how to do that
ABAddressBookRef ab;
ab = ABAddressBookCreate();
int len = (int) ABAddressBookGetPersonCount(ab);
int i;
for(i = 1; i < (len + 1); i++)
{
ABRecordRef person = ABAddressBookGetPersonWithRecordID(ab,(ABRecordID) i);
NSString *firstName;
firstName = ABRecordCopyValue(person, kABPersonFirstNameProperty);
if([firstName isEqualToString:selectedName])
//Add to array
}
精彩评论