| Derived from | CFTypeRef |
| Framework | AddressBook/AddressBook.h |
| Declared in | ABAddressBook.h ABGroup.h ABPerson.h |
The ABAddressBook opaque type (instances of which are known as address books) provides a programming interface to the Address Book—a centralized database used by multiple applications to store personal information about people. The Address Book database also supports the notion of a “group” containing one or more persons. People may belong to multiple groups, and groups may also belong to other groups.
The ABAddressBook opaque type provides functions for creating references to the Address Book database, saving changes, discarding changes, and registering for changes made externally (by other threads or processes) to the database.
ABAddressBookAddRecord
ABAddressBookRemoveRecord
ABAddressBookGetPersonCount
ABAddressBookCopyArrayOfAllPeople
ABAddressBookGetGroupCount
ABAddressBookCopyArrayOfAllGroups
Adds a record to an address book.
bool ABAddressBookAddRecord ( ABAddressBookRef addressBook, ABRecordRef record, CFErrorRef *error );
The address book to which record is added.
The record to add to addressBook.
On error, contains error information. See “Address Book Errors.”
true when successful, false otherwise.
ABAddressBook.hReturns an array with all the groups in an address book.
CFArrayRef ABAddressBookCopyArrayOfAllGroups ( ABAddressBookRef addressBook );
The address book from which to return the groups
Array containing the groups in addressBook.
ABGroup.hReturns all the person records in an address book.
CFArrayRef ABAddressBookCopyArrayOfAllPeople ( ABAddressBookRef addressBook );
The address book whose person records to return.
Array containing the person records in addressBook.
ABPerson.hReturns a localized version of record-property label.
CFStringRef ABAddressBookCopyLocalizedLabel ( CFStringRef label );
The label to localize.
The label localized to the user’s locale.
ABAddressBook.hReturns a new address book with data from the Address Book database.
ABAddressBookRef ABAddressBookCreate ( void );
New address book with data from the Address Book database.
Changes made to the returned address book are reflected in the Address Book database only after saving the address book with ABAddressBookSave.
ABAddressBook.hReturns the number of groups in an address book.
CFIndex ABAddressBookGetGroupCount ( ABAddressBookRef addressBook );
The address book whose record count to return.
The number of groups in addressBook.
ABGroup.hReturns the number of person records in an address book.
CFIndex ABAddressBookGetPersonCount ( ABAddressBookRef addressBook );
The address book whose person-record count to return.
The number of person records in addressBook.
ABPerson.hIndicates whether an address book has changes that have not been saved to the Address Book database.
bool ABAddressBookHasUnsavedChanges ( ABAddressBookRef addressBook );
The address book in question.
true when addressBook contains unsaved changes, false otherwise.
ABAddressBook.hRegisters a callback to receive notifications when the Address Book database is modified.
void ABAddressBookRegisterExternalChangeCallback ( ABAddressBookRef addressBook, ABExternalChangeCallback callback, void *context );
The address book used to interact with the Address Book database.
The function to invoke when the Address Book database changes.
Object to pass to the callback function.
ABAddressBook.hRemoves a record from an address book.
bool ABAddressBookRemoveRecord ( ABAddressBookRef addressBook, ABRecordRef record, CFErrorRef *error );
The address book from which record is removed.
The record to remove from addressBook.
On error, contains error information. See “Address Book Errors.”
true when successful, false otherwise.
ABAddressBook.hDiscards unsaved changes in an address book.
void ABAddressBookRevert ( ABAddressBookRef addressBook );
The address book to revert.
The addressBook address book is loaded with the information in the Address Book database.
ABAddressBook.hSaves unsaved changes to an address book to the Address Book database.
bool ABAddressBookSave ( ABAddressBookRef addressBook, CFErrorRef *error );
The address book to save.
On error, contains error information. See “Address Book Errors.”
true when successful, false otherwise.
ABAddressBook.hUnregisters a callback.
void ABAddressBookUnregisterExternalChangeCallback ( ABAddressBookRef addressBook, ABExternalChangeCallback callback, void *context );
The address book used to interact with the Address Book database.
The function to invoke when the Address Book database changes. Must match the callback used in the registration.
Object to pass to the callback function. Must match the callback used in the registration.
ABAddressBook.hPrototype for a function callback invoked on an address book when the Address Book database is modified by another address book instance.
typedef void (*ABExternalChangeCallback) ( ABAddressBookRef addressBook, CFDictionaryRef info, void *context );
If you name your callback function MyAddressBookExternalChangeCallback, you declare it like this:
void *MyAddressBookExternalChangeCallback ( ABAddressBookRef addressBook, CFDictionaryRef info, void *context );
An address book used to interact with the Address Book database.
Always NULL.
Object to pass to the callback function.
Use ABAddressBookRegisterExternalChangeCallback to register and ABAddressBookUnregisterExternalChangeCallback to unregister the callback function.
You can register for callback with different contexts or callback functions. The run loop on the thread that registered the callback invokes the callback.
The addressBook object does not take any action to flush or synchronize cached state with the Address Book database. If you want to ensure that addressBook doesn’t contain stale values, use ABAddressBookRevert.
ABAddressBook.hReference to an object used to interact with the Address Book database.
typedef CFTypeRef ABAddressBookRef;
ABAddressBook.hThis constant identifies the error domain under which “Address Book Errors” are grouped.
const CFStringRef ABAddressBookErrorDomain;
ABAddressBookErrorDomainThe main error domain for Address Book framework operations.
Available in iPhone OS 2.0 and later.
Declared in ABAddressBook.h.
Errors that can be raised under the “Address Book Error Domain.”
enum {
kABOperationNotPermittedByStoreError = 0
};
kABOperationNotPermittedByStoreErrorThe operation is not allowed by the Address Book database.
Available in iPhone OS 2.0 and later.
Declared in ABAddressBook.h.
Last updated: 2009-05-26