iphone带来地址簿联系

时间:2010-01-25 21:06:22

标签: iphone addressbook contact

在给定ABReferenceID的情况下访问iphone地址簿时遇到了一些问题。

正确调用该方法(accessoryButtonTappedForRowWithIndexPath),所有#import的东西都没问题(因为我可以保存数据没问题)。

我与ReferenceID = 69273024有联系,我只想带他'。

我试图用以下技术做到这一点,但第2行是错误的。我无法弄清楚如何正确地将数字整合到问题中。有什么提示吗?

ABPersonViewController *pvc = [[ABPersonViewController alloc] init];
pvc.displayedPerson = 69273024;

[[self navigationController] pushViewController:pvc animated:YES];  

问候,norskben。

1 个答案:

答案 0 :(得分:2)

displayedPerson属性应设置为ABRecordRef。您可以使用ABAddressBookGetPersonWithRecordID从ABRecordID获取ABRecordRef。您可以使用ABAddressBookCreate获取ABAddressBookRef。

<强>更新
这是示例代码,但我还没有测试过:

ABPersonViewController *pvc = [[ABPersonViewController alloc] init];
pvc.displayedPerson = ABAddressBookGetPersonWithRecordID(ABAddressBookCreate(),69273024);

[[self navigationController] pushViewController:pvc animated:YES];
[pvc release];
相关问题