Cocoa Address Book API - Nothing works!

cbl2001

Registered
Hi,

I am trying to build address book access into my cocoa app using the address book API. No matter what I do (using every example I've found on the web), I get the following error message:

ZeroLink: unknown symbol '_kABGroupNameProperty'

Which I figure is telling me I've missed a definition somewhere, but i have imported the <AddressBook/AddressBook.h> header file as described in the API docs.

Any help would be greatly appreciated!

Here's the code:




#import <AddressBook/AddressBook.h>

[....]

-(id) init
{
[super init];

clients = [ [NSMutableArray alloc] initWithCapacity:1024 ];

ABAddressBook* book = [ ABAddressBook sharedAddressBook ];

ABSearchElement* se = [ ABGroup searchElementForProperty:kABGroupNameProperty
label:nil
key:nil
value:mad:"MyGroup"
comparison:kABEqual ];

NSArray* results = [ book recordsMatchingSearchElement: se ];

NSLog( [results description ] );

return( self );
}



Thanks in advance!
Chris
--
www.chrisblunt.com
 
Make sure you add the AddressBook.framework to your project. It's located at /System/Library/Frameworks/AddressBook.framework - just go to Project > Add to Project and select this framework.
 
Back
Top