Re: AddressBook - how to search for absence of value?
Re: AddressBook - how to search for absence of value?
- Subject: Re: AddressBook - how to search for absence of value?
- From: Vince DeMarco <email@hidden>
- Date: Tue, 15 Oct 2002 16:15:06 -0700
On Tuesday, October 15, 2002, at 01:59 PM, Jim Correia wrote:
[Pardon the question on the Cocoa list. As far as I know there isn't a
specific list for the AddressBook.]
I'd like to query the Address Book for the absence of a term.
Specifically I want to find all values whose first name is empty, and
whose last name starts with a specific value. The following code
doesn't work. When I log all the values from the address book it
doesn't log any value for the first name of the entry that doesn't
have one.
What am I doing wrong?
I just tried this on my and address book is definitely broken. here.
I'll file a bug for you. its bug #3076439
vince
Thanks,
Jim
#import <AddressBook/AddressBook.h>
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
ABSearchElement *elem1 = [ABPerson searchElementForProperty:
kABFirstNameProperty label: nil key: nil value: @"" comparison:
kABEqual];
ABSearchElement *elem2 = [ABPerson searchElementForProperty:
kABLastNameProperty label: nil key: nil value: @"z" comparison:
kABPrefixMatchCaseInsensitive];
NSArray *elements = [NSArray arrayWithObjects: elem1, elem2, nil];
ABSearchElement *conjunction = [ABSearchElement
searchElementForConjunction: kABSearchAnd children: elements];
NSArray *matches = [[ABAddressBook sharedAddressBook]
recordsMatchingSearchElement: conjunction];
NSLog(@"%@", matches);
NSLog(@"%@", [[ABAddressBook sharedAddressBook] people]);
[pool release];
return 0;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.