Reputation: 503
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.
Upvotes: 2
Views: 1834
Reputation: 301
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
Upvotes: 4