Mac OS X Reference Library Apple Developer Connection spyglass button

ABPeoplePickerView Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AddressBook.framework
Availability
Available in Mac OS X v10.3 and later
Companion guide
Declared in
ABPeoplePickerView.h
Related sample code

Overview

The ABPeoplePickerView class allows you to customize the behavior of people-picker views in an application’s user interface.

Tasks

Working with Properties in the Record List

Specifying Selection Behavior

Selecting Groups and Records

Specifying the Accessory View

Managing Actions

Managing Persistent User Settings

Properties

For more about Objective-C properties, see “Properties” in The Objective-C Programming Language.

accessoryView

The view that is placed to the left of the search field.

@property (nonatomic, retain) NSView* accessoryView
Discussion

If accessory is nil, the accessory view is removed.

Availability
Declared In
ABPeoplePickerView.h

allowsGroupSelection

A Boolean value that specifies whether the user can select entire groups in the group column.

@property (nonatomic, assign) BOOL allowsGroupSelection
Discussion

If YES, the user can to select entire groups. If NO, the user is required to select at least one person in the group.

Availability
Declared In
ABPeoplePickerView.h

allowsMultipleSelection

A Boolean value that specifies whether multiple groups, records, or values of multivalue properties can be selected at a time.

@property (nonatomic, assign) BOOL allowsMultipleSelection
Availability
Declared In
ABPeoplePickerView.h

autosaveName

The name under which the column positions and the filter selection are saved.

@property (nonatomic, retain) NSString* autosaveName
Availability
Declared In
ABPeoplePickerView.h

displayedProperty

The property currently displayed in the record list.

@property (nonatomic, retain) NSString* displayedProperty
Availability
Declared In
ABPeoplePickerView.h

groupDoubleAction

The action to be invoked when a group is double-clicked.

@property (nonatomic, assign) SEL groupDoubleAction
Availability
Declared In
ABPeoplePickerView.h

nameDoubleAction

The action to be invoked when a name is double-clicked.

@property (nonatomic, assign) SEL nameDoubleAction;
Availability
Declared In
ABPeoplePickerView.h

selectedGroups

The groups selected in the group list. (read-only)

@property (readonly) NSArray* selectedGroups
Discussion

The selected groups are returned as an array of ABGroup objects.

Availability
Declared In
ABPeoplePickerView.h

selectedRecords

The selection in the records list. (read-only)

@property (readonly) NSArray* selectedRecords
Discussion

The selection is returned as an array of ABGroup or ABPerson objects.

Availability
See Also
Declared In
ABPeoplePickerView.h

target

The target for double-click actions.

@property (nonatomic, assign) id target
Discussion

The target is the object on which the action specified by groupDoubleAction and nameDoubleAction is invoked.

Availability
Declared In
ABPeoplePickerView.h

valueSelectionBehavior

The current selection behavior.

@property (nonatomic, assign) ABPeoplePickerSelectionBehavior valueSelectionBehavior
Discussion

The default behavior is ABSingleValueSelection.

Availability
See Also
Declared In
ABPeoplePickerView.h

Instance Methods

addProperty:

Adds a property to the group of properties whose values are shown in the record list.

- (void)addProperty:(NSString *)property

Parameters
property

The property to add.

Discussion

For additional information about properties see “Constants” in ABPerson Class Reference.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

clearSearchField:

Clears the search field and resets the list of displayed records.

- (void)clearSearchField:(id)sender

Parameters
sender

The object sending this message.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
ABPeoplePickerView.h

columnTitleForProperty:

Returns the title of a custom property.

- (NSString *)columnTitleForProperty:(NSString *)property

Parameters
property

The property whose title will be returned.

Return Value

The title of the custom property.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

deselectAll:

Deselects all selected groups, records, and values in multivalue properties.

- (void)deselectAll:(id)sender

Parameters
sender

The object sending this message.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
ABPeoplePickerView.h

deselectGroup:

Deselects a group selected in the group list.

- (void)deselectGroup:(ABGroup *)group

Parameters
group

The group to deselect.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

deselectIdentifier:forPerson:

Deselects a value selected in a multivalue property.

- (void)deselectIdentifier:(NSString *)identifier forPerson:(ABPerson *)person

Parameters
identifier

The identifier of the value that will be deselected.

person

The person whose value will be deselected.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

deselectRecord:

Deselects a record selected in the record list.

- (void)deselectRecord:(ABRecord *)record

Parameters
record

The record to deselect.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

editInAddressBook:

Launches Address Book to edit the item selected in the people picker.

- (void)editInAddressBook:(id)sender

Parameters
sender

The object sending this message.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

properties

Returns an array of the properties whose values are shown in the record list.

- (NSArray *)properties

Discussion

For additional information about properties see “Using Property Lists” in Address Book Programming Guide for Mac OS X.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

removeProperty:

Removes a property from the group of properties whose values are shown in the record list.

- (void)removeProperty:(NSString *)property

Parameters
property

The property to remove.

Discussion

For additional information about properties see “Using Property Lists” in Address Book Programming Guide for Mac OS X.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

selectedIdentifiersForPerson:

Returns the identifiers of the selected values in a multivalue property.

- (NSArray *)selectedIdentifiersForPerson:(ABPerson *)person

Parameters
person

The person whose identifiers for selected values will be returned.

Discussion

Returns nil if the property displayed is a single-value property.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

selectedValues

Returns an array of all the values selected in the displayed multivalue property.

- (NSArray *)selectedValues

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
ABPeoplePickerView.h

selectGroup:byExtendingSelection:

Selects a group or a set of groups in the group list.

- (void)selectGroup:(ABGroup *)group byExtendingSelection:(BOOL)extend

Parameters
group

The group to be selected, or to be added to the current selection.

extend

YES to extend the current selection; otherwise, NO.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

selectIdentifier:forPerson:byExtendingSelection:

Selects a value or a set of values in a multivalue property.

- (void)selectIdentifier:(NSString *)identifier forPerson:(ABPerson *)person byExtendingSelection:(BOOL)extend

Parameters
identifier

The identifier to be selected, or to be added to the current selection.

person

The person that the value to be selected is associated with.

extend

YES to extend the current selection; otherwise, NO.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

selectInAddressBook:

Launches Address Book and selects the item selected in the people picker.

- (void)selectInAddressBook:(id)sender

Parameters
sender

The object sending this message.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

selectRecord:byExtendingSelection:

Selects a record or a set of records in the record list.

- (void)selectRecord:(ABRecord *)record byExtendingSelection:(BOOL)extend

Parameters
record

The record to be selected, or to be added to the current selection.

extend

YES to extend the current selection; otherwise, NO.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

setColumnTitle:forProperty:

Sets the title displayed in the people picker for a property.

- (void)setColumnTitle:(NSString *)title forProperty:(NSString *)property

Parameters
title

The title to be set.

property

The property being titled.

Availability
  • Available in Mac OS X v10.3 and later.
See Also
Declared In
ABPeoplePickerView.h

Constants

Selection Behavior

These constants are of the type Selection Behavior and are used by valueSelectionBehavior.

typedef enum {
   ABNoValueSelection       = 0,
   ABSingleValueSelection   = 1,
   ABMultipleValueSelection = 2
} ABPeoplePickerSelectionBehavior;
Constants
ABNoValueSelection

The user cannot select individual values.

Available in Mac OS X v10.3 and later.

Declared in ABPeoplePickerView.h.

ABSingleValueSelection

The user can select a single value.

Available in Mac OS X v10.3 and later.

Declared in ABPeoplePickerView.h.

ABMultipleValueSelection

The user can select multiple values.

Available in Mac OS X v10.3 and later.

Declared in ABPeoplePickerView.h.

Notifications

ABPeoplePickerGroupSelectionDidChangeNotification

Posted when the selection in the group list is changed.

Availability
Declared In
ABPeoplePickerView.h

ABPeoplePickerNameSelectionDidChangeNotification

Posted when the selection in the name list is changed.

Availability
Declared In
ABPeoplePickerView.h

ABPeoplePickerValueSelectionDidChangeNotification

Posted when the selection in a multivalue property is changed.

Availability
Declared In
ABPeoplePickerView.h

ABPeoplePickerDisplayedPropertyDidChangeNotification

Posted when the displayed property in the record list is changed.

Availability
Declared In
ABPeoplePickerView.h


Last updated: 2009-08-06

Did this document help you? Yes It's good, but... Not helpful...