开发者

Creating an ABPerson object

This problem is almost certainly gonna have a really simple answer, but I just can't see it. I'm programming an app for the iPhone in Xcode and I'm trying to create an instance of an ABPerson object, but can't. In my .h file, I am importing as follows:

#import <AddressBook/AddressBook.h>
#import <AddressBook/ABPerson.h>

Then when I try to create it using "ABPerson *person;", it gives the error, "Unknown type name 'ABPerson'".

I have searched the internet and there doesn't seem to be much on the use of ABPerson and where I have seen it used, they have done it like this and its worked fine.

Ultimately, I want to create a VCard containing the details of somebody whi开发者_开发问答ch the user can then save to their phone so if you know of another way of doing this which would eliminate this problem, that would also be great.

Thanks,

Matthew


Have you added the AddressBook framework to your app? Look in XCode4, look at your project file -> Build Phases -> Link Binary with Libraries.


Try this.

#import <AddressBook/AddressBook.h>
#import <AddressBook/ABAddressBook.h>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜