문제

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

도움이 되었습니까?

해결책

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top