Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

ABSearchElement Class Objective-C Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AddressBook.framework
Availability
Available in Mac OS X v10.2 and later.
Companion guide
Declared in
ABSearchElement.h
ABTypedefs.h

Overview

ABSearchElement is used to specify a search query for records in the Address Book database.

You can create a simple query by creating an ABSearchElement object using either the ABGroup searchElementForProperty:label:key:value:comparison: or ABPerson searchElementForProperty:label:key:value:comparison: methods. Then you use the ABAddressBook recordsMatchingSearchElement: method, passing the ABSearchElement as the argument, to query the database.

ABSearchElement also provides a method for creating compound queries. Use the searchElementForConjunction:children: method to combine two simple or complex queries into a compound query using either the kABSearchAnd or kABSearchOr conjunction constants.

Use the matchesRecord: function to test whether a specific record matches a query.

The ABSearchElement class is “toll-free bridged” with its procedural C, opaque type, counterpart. This means that the ABSearchElementRef type is interchangeable in function or method calls with instances of the ABSearchElement class.

Tasks

Searching

Matching

Class Methods

searchElementForConjunction:children:

+ (ABSearchElement *)searchElementForConjunction:(ABSearchConjunction)conjunction children:(NSArray *)children

Discussion

Returns a compound search element created by combining the search elements in an array with the given conjunction. The objects in the children array must be ABSearchElement objects. The conjunction can be kABSearchAnd or kABSearchOr. If children is nil or empty, this method raises an exception.

Availability
See Also
Declared In
ABSearchElement.h

Instance Methods

matchesRecord:

- (BOOL)matchesRecord:(ABRecord *)record

Discussion

Tests whether or not a record matches a search element. Returns YES if the record argument satisfies the conditions in the search element, NO otherwise. If record is nil, this method raises an exception.

Availability
See Also
Declared In
ABSearchElement.h

Constants

These constants are of the type ABSearchConjunction and are used by searchElementForConjunction:children:.

Constant

Description

kABSearchAnd

Join the search elements together with the AND operand.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABSearchOr

Join the search elements together with the OR operand.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

These constants are of the type ABSearchComparison and are used by the ABPerson method searchElementForProperty:label:key:value:comparison: and the ABGroup method searchElementForProperty:label:key:value:comparison:.

Constant

Description

kABEqual

Search for elements that are equal to the value.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABNotEqual

Search for elements that are not equal to the value.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABNotEqualCaseInsensitive

Search for elements that are not equal to the value, ignoring case. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABLessThan

Search for elements that are less than the value.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABLessThanOrEqual

Search for elements that are less than or equal to the value.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABGreaterThan

Search for elements that are greater than the value.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABGreaterThanOrEqual

Search for elements that are greater than or equal to the value.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABEqualCaseInsensitive

Search for elements that are equal to the value, ignoring case.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABContainsSubString

Search for elements that contain the value.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABContainsSubStringCaseInsensitive

Search for elements that contain the value, ignoring case.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABPrefixMatch

Search for elements that begin with the value.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABPrefixMatchCaseInsensitive

Search for elements that begin with the value, ignoring case.

Available in Mac OS X v10.2 and later.

Declared in ABTypedefs.h

kABSuffixMatch

Search for elements that end with the value. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABSuffixMatchCaseInsensitive

Search for elements that end with the value, ignoring case. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABBitsInBitFieldMatch

Search for elements that match the bits in ABPersonFlags. (Available in Mac OS X v10.3 and later.)

Available in Mac OS X v10.3 and later.

Declared in ABTypedefs.h

kABDoesNotContainSubString

Search for elements that do not contain the value. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABDoesNotContainSubStringCaseInsensitive

Search for elements that do not contain the value, ignoring case. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABWithinIntervalAroundToday

Search for elements that are within a time interval (in seconds) forward or backward from today. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABWithinIntervalAroundTodayYearless

Search for elements that are within a time interval (in seconds) forward or backward from this day in any year. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABNotWithinIntervalAroundToday

Search for elements that are not within a time interval (in seconds) forward or backward from today. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABNotWithinIntervalAroundTodayYearless

Search for elements that are not within a time interval (in seconds) forward or backward from this day in any year. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABWithinIntervalFromToday

Search for elements that are within a time interval (in seconds) forward from today. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABWithinIntervalFromTodayYearless

Search for elements that are within a time interval (in seconds) forward from this day in any year. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABNotWithinIntervalFromToday

Search for elements that are not within a time interval (in seconds) forward from today. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h

kABNotWithinIntervalFromTodayYearless

Search for elements that are not within a time interval (in seconds) forward from this day in any year. (Available in Mac OS X v10.4 and later.)

Available in Mac OS X v10.4 and later.

Declared in ABTypedefs.h



Next Page > Hide TOC


Last updated: 2006-05-23




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice