开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜