|
#1
| |||
| |||
| Cocoa Address Book API - Nothing works! 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:@"MyGroup" comparison:kABEqual ]; NSArray* results = [ book recordsMatchingSearchElement: se ]; NSLog( [results description ] ); return( self ); } Thanks in advance! Chris -- www.chrisblunt.com |
|
#2
| |||
| |||
| 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. |
|
#3
| |||
| |||
| hi that's worked, thanks! always the smallest of mistakes causing the biggest headaches! Cheers, Chris -- www.chrisblunt.com |