如何从联系人中获取图像
我已经添加了框架:
#import "AddressBook/ABAddressBook.h"
#import "AddressBookUI/AddressBookUI.h"
我想要获取图像。您可以修改我的代码,或者给我链接,
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef nameArray = ABAddressBookCopyArrayOfAllPeople (addressBook);
m_SourceContactsUserArray = [[NSMutableArray alloc] init];
for (int i = 0; i<CFArrayGetCount(nameArray); i++) {
ABRecordRef person = CFArrayGetValueAtIndex(nameArray, i);
NSString *personName = (NSString*)ABRecordCopyValue(person,kABPersonFirstNameProperty);
[m_SourceContactsUserArray addObject:personName];
}
CFRelease(addressBook);
CFRelease(nameArray);
非常感谢。
I have added the framework:
#import "AddressBook/ABAddressBook.h"
#import "AddressBookUI/AddressBookUI.h"
I want to get the image.you can modify my code ,or give me links
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef nameArray = ABAddressBookCopyArrayOfAllPeople (addressBook);
m_SourceContactsUserArray = [[NSMutableArray alloc] init];
for (int i = 0; i<CFArrayGetCount(nameArray); i++) {
ABRecordRef person = CFArrayGetValueAtIndex(nameArray, i);
NSString *personName = (NSString*)ABRecordCopyValue(person,kABPersonFirstNameProperty);
[m_SourceContactsUserArray addObject:personName];
}
CFRelease(addressBook);
CFRelease(nameArray);
thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下面的链接一定会对您有所帮助...
http://adeem.me/blog/2009/04/02/get-image-from-contact-stored-in-addressbook/
或
从 iPhone 地址簿获取人员图像
The below links will definitely help you...
http://adeem.me/blog/2009/04/02/get-image-from-contact-stored-in-addressbook/
or
Get image of a person from iPhone address book