Question

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 which 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

Was it helpful?

Solution

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

OTHER TIPS

Try this.

#import <AddressBook/AddressBook.h>
#import <AddressBook/ABAddressBook.h>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top