views:

120

answers:

1

I'm new to iPhone development and Xcode, so this might be really obvious.

I have the exact same problem as referenced on this forum post

I've created a simple list application, starting out with a custom datasource class that simply returns a hard-wired list of data. With that working, I'm now attempting to alter my datasource class to pull data from the address book. I've added a reference to AddressBook/ABAddressBook.h and created an ABAddressBookRef variable. The application compiles fine with that, and I'm able to get Code Sense into the ABAddressBook API. However, if I attempt to initialize my ABAddressBookRef variable by calling ABAddressBookCreate(), I get a link error like this:

"_ABAddressBookCreate", referenced from: -[TestTableDataSource init] in TestTableDataSource.o symbol(s) not found collect2: id returned 1 exit status

The answer to the problem is that he didn't linked the entire framework (see thread)... but what does that mean and how do you do that?

+1  A: 

Is this as simple as right-clicking on the "Frameworks" folder, choosing "Add existing Framework" and then navigating to the framework that should be included? (usually two, IIRC, for Address Book).

Adam Eberbach
Makes sense, thanks. I didn't see it was so obvious ^^ Last question: Why do I have to do that when I already include the correct header file?
marcgg
The header file only exposes the external interface (so your code knows what classes and methods are available). You need to link with the framework/library to get the implementation.
Jasarien