iPhone地址簿保存联系人的链接
在我的 iPhone 应用程序中,我希望将联系人链接到数组中的数据块。所有数据处理都很好。我的问题是:什么联系信息参数可以保存在数据库中,充当联系人的链接。然后我就可以调用这个值,然后将链接返回给联系人。
---编辑如下
这是我要做的,但我还不能把它做好。我让联系人视图滑过,但它包含一个空联系人。有人可以帮忙吗?
ABPersonViewController *pvc = [[ABPersonViewController alloc] init];
int referenceid = 69249600;
ABAddressBookRef addressBook;
addressBook = ABAddressBookCreate();
ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressBook, referenceid);
//ABAddressBookGetPersonWithRecordID()
pvc.displayedPerson = person;
[[self navigationController] pushViewController:pvc animated:YES];
NSLog(@"customerRecID %d", pvc.displayedPerson);
in my iphone app, I'm wishing to link a contact to a data-piece in an array. All the data handling is fine. My question is: what contact info parameter can be saved in a database, acting as a link to a contact. Then later I will be able to call this one value and then get the link back to the contact.
---EDIT BELOW
This is where I am up to, but I just cant get it right yet. I get the contact view sliding over, but it contains an empty contact. Can someone please help.
ABPersonViewController *pvc = [[ABPersonViewController alloc] init];
int referenceid = 69249600;
ABAddressBookRef addressBook;
addressBook = ABAddressBookCreate();
ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressBook, referenceid);
//ABAddressBookGetPersonWithRecordID()
pvc.displayedPerson = person;
[[self navigationController] pushViewController:pvc animated:YES];
NSLog(@"customerRecID %d", pvc.displayedPerson);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,ABRecordID 就是您想要使用的。不确定“将此称为变量”是什么意思。如果要将 ABRecordRef 转换为 ABRecordID,请使用 ABRecordGetRecordID()。
Yes, ABRecordID is what you want to use. Not sure what you mean by "call this as a variable". If you want to convert an ABRecordRef to an ABRecordID, use ABRecordGetRecordID().