iPhone: “error: ABPerson.h: No such file or directory”… How to use the ABPerson class?
-
22-07-2019 - |
Question
I'm trying to use the ABPerson object. The documentation tells me to include ABPerson.h.
Here is basically my code:
#import "ABPerson.h"
[...]
-(void) updateImageWithContact:(ABPerson)contact;
The problem is that I get an error:
error: ABPerson.h: No such file or directory
I did include Addressbook.framework so I don't know what's going on.
If I remove the #import there is no error, but I can't use the ABPerson class.
Solution
Try
#import <AddressBook/ABPerson.h>
Edit:
There's no ABPerson type - all records (for person or group) are of ABRecordRef type - so you should use that
Better use
#import <AddressBook/AddressBook.h>
and you'll need no extra headers for working with address bookTo access Address book standard pickers include
<AddressBook/AddressBookUI.h>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow