ABSearchElement Class Objective-C Reference
| Inherits from | |
| Conforms to | |
| 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
- Available in Mac OS X v10.2 and later.
See Also
Declared In
ABSearchElement.hInstance 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
- Available in Mac OS X v10.2 and later.
See Also
Declared In
ABSearchElement.hConstants
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 |