Searching AddressBook
Searching AddressBook
- Subject: Searching AddressBook
- From: "Mark's Studio" <email@hidden>
- Date: Thu, 5 Sep 2002 10:33:56 +0200
How do i setup a search to only return members of a group?
This is my search function and i know it's not working because the
first search element is a ABGroup,
what i want is the recordsMatchingSearchElement: to return ABPerson's
who is member of ABGroup with "gName" AND
matches any of the other name searches.
So how do i setup a search like that?
ABSearchElement *groupName = [ABGroup
searchElementForProperty:kABGroupNameProperty
label:nil
key:nil
value:gName
comparison:kABEqual];
ABSearchElement *firstName = [ABPerson
searchElementForProperty:kABFirstNameProperty
label:nil
key:nil
value:[searchField stringValue]
comparison:kABPrefixMatchCaseInsensitive];
ABSearchElement *lastName = [ABPerson
searchElementForProperty:kABLastNameProperty
label:nil
key:nil
value:[searchField stringValue]
comparison:kABPrefixMatchCaseInsensitive];
ABSearchElement *comName = [ABPerson
searchElementForProperty:kABOrganizationProperty
label:nil
key:nil
value:[searchField stringValue]
comparison:kABPrefixMatchCaseInsensitive];
ABSearchElement *allThree = [ABSearchElement
searchElementForConjunction:kABSearchOr
children:[NSArray
arrayWithObjects:
firstName,
lastName,comName, nil]];
ABSearchElement *allAndGroup = [ABSearchElement
searchElementForConjunction:kABSearchAnd
children:[NSArray
arrayWithObjects:
allThree,groupName, nil]];
peopleFound = [AB recordsMatchingSearchElement:allAndGroup];
Thanks
Peter Mark
Mark's Recording Studio A/S
Faelledvej 19 b DK2200 N
Copenhagen Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden
_______________________________________________
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.