Re: Searching AddressBook
Re: Searching AddressBook
- Subject: Re: Searching AddressBook
- From: Henri Lamiraux <email@hidden>
- Date: Thu, 5 Sep 2002 06:04:47 -0700
The way to do that would be to search for all people that matches, then
search for all groups that matches and finally go through the returned
people list and verify that they belong to one of the returned group.
There is no direct way to do what you want.
On Thursday, September 5, 2002, at 01:33 AM, Mark's Studio wrote:
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.
Henri Lamiraux
Engineering Manager
User Interface Tools Group
Apple
_______________________________________________
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.