Function

ABGroupCreateSearchElement

Creates an ABSearchElement object that specifies a query for ABGroup records.

Declaration

ABSearchElementRef ABGroupCreateSearchElement(CFStringRef property, CFStringRef label, CFStringRef key, CFTypeRef value, ABSearchComparison comparison);

Parameters

property

The name of the property to search on. It cannot be NULL. For a full list of the properties, see Group Properties and Common Properties.

label

The label name for a multi-value list. If property does not have multiple values, pass NULL. If property does have multiple values, pass NULL to search all the values. By default, ABGroup records don’t contain any multi-value list properties.

key

The key name for a dictionary. If property is not a dictionary, pass NULL. If property is a dictionary, pass NULL to search all keys. By default, ABGroup records don’t contain any properties that are dictionaries.

value

The value you are searching for. It cannot be NULL

comparison

Specifies the type of comparison to perform, such as kABEqual or kABPrefixMatchCaseInsensitive. For a full list, see ABSearchComparison.

Return Value

A search element object that specifies a query according to the above parameters. You are responsible for releasing this object.

Discussion

Use the ABAddressBook ABCopyArrayOfMatchingRecords function to actually perform the query. Also, see ABSearchElement C for more functions that create compound queries.

See Also

Groups

ABCopyArrayOfAllGroups

Returns an array of all the groups in the Address Book database.

ABGroupAddGroup

Adds a subgroup to another group.

ABGroupAddMember

Adds a person to a group.

ABGroupCopyArrayOfAllMembers

Returns an array of persons in a group.

ABGroupCopyArrayOfAllSubgroups

Returns an array containing a group’s subgroups.

ABGroupCopyDistributionIdentifier

Returns the distribution identifier for the given property and person.

ABGroupCopyParentGroups

Returns an array containing a group’s parents—the groups that a group belongs to.

ABGroupCreate

Returns a new ABGroup object.

ABGroupRemoveGroup

Removes a subgroup from a group.

ABGroupRemoveMember

Removes a person from a group.

ABGroupSetDistributionIdentifier

Assigning a specific distribution identifier for a person’s multi-value list property so that the group can be used as a distribution list (mailing list, in the case of an email property).