• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Searching AddressBook
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Searching AddressBook
      • From: Henri Lamiraux <email@hidden>
  • Prev by Date: Re: iso-8859-1 over UTF8 (was: Re: cString deprecated!)
  • Next by Date: nsmovieview problem
  • Previous by thread: NSGraphicsContext help...
  • Next by thread: Re: Searching AddressBook
  • Index(es):
    • Date
    • Thread