开发者

iPhone: "error: ABPerson.h: No such file or directory"... How to use the ABPerson class?

开发者 https://www.devze.com 2022-12-10 08:50 出处:网络
I\'m trying to use the ABPerson object. The documentation tells me to include ABPerson.h. Here is basically my code:

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 #im开发者_Python百科port there is no error, but I can't use the ABPerson class.


Try

#import <AddressBook/ABPerson.h>

Edit:

  1. There's no ABPerson type - all records (for person or group) are of ABRecordRef type - so you should use that

  2. Better use #import <AddressBook/AddressBook.h> and you'll need no extra headers for working with address book

  3. To access Address book standard pickers include <AddressBook/AddressBookUI.h>

0

精彩评论

暂无评论...
验证码 换一张
取 消