如何在可可中使用AddressBook框架设置隐藏标签和值?
我知道如何将标签和值添加到本地联系人中,就像这样: CFErrorRef 错误;
ABMultiValueRef ref = ABRecordCopyValue(self.record, kABPersonPhoneProperty);
ABMutableMultiValueRef copyOfRef = ABMultiValueCreateMutableCopy(ref);
ABMultiValueAddValueAndLabel(copyOfRef, (CFStringRef)account, kABPersonPhoneMobileLabel, NULL);
ABRecordSetValue(self.record, kABPersonPhoneProperty, copyOfRef, &error);
ECP4iPhoneAppDelegate *appDelegate = (ECP4iPhoneAppDelegate *) [[UIApplication sharedApplication] delegate];
ABAddressBookSave([appDelegate.gLABAddressBook addressBook], &error);
CFRelease(copyOfRef);
CFRelease(ref);
但是我如何将隐藏标签和值添加到本地联系人中?因为我想在我自己的应用程序中使用一些属性,thx
I know how to add a label&value into a local contact,just like this:
CFErrorRef error;
ABMultiValueRef ref = ABRecordCopyValue(self.record, kABPersonPhoneProperty);
ABMutableMultiValueRef copyOfRef = ABMultiValueCreateMutableCopy(ref);
ABMultiValueAddValueAndLabel(copyOfRef, (CFStringRef)account, kABPersonPhoneMobileLabel, NULL);
ABRecordSetValue(self.record, kABPersonPhoneProperty, copyOfRef, &error);
ECP4iPhoneAppDelegate *appDelegate = (ECP4iPhoneAppDelegate *) [[UIApplication sharedApplication] delegate];
ABAddressBookSave([appDelegate.gLABAddressBook addressBook], &error);
CFRelease(copyOfRef);
CFRelease(ref);
But how could I add a hidden label and value into a local contact?Because I wanna use some properties in my own app,thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以据我所知这是不可能的
So it is impossible as far as I know