开发者

displaying contacts in a UItableview

开发者 https://www.devze.com 2023-02-08 14:35 出处:网络
i am able to add contacts (iphone contacts ) to a table view all at once by clicking ref开发者_开发知识库resh button in my application .

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
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号