ABSource Reference

Framework
AddressBook/AddressBook.h
Declared in
ABSource.h

Overview

Sources of contact information are represented by instances of the ABRecordRef opaque type, whose record type is kABSourceType. Examples of sources include the local address book database, CardDAV servers, and social networking sites.

Not all sources support groups. Each record in the address book database can belong to only one source. Folders from Exchange accounts are represented in the address book database as sources.

Functions

ABAddressBookCopyArrayOfAllSources

Returns an array of all sources in the address book.

CFArrayRef ABAddressBookCopyArrayOfAllSources (
   ABAddressBookRef addressBook
);
Parameters
addressBook

The address book whose source records are being returned.

Return Value

Array containing the source records in addressBook.

Availability
  • Available in iOS 4.0 and later.
Related Sample Code
Declared In
ABSource.h

ABAddressBookCopyDefaultSource

Returns the default source.

ABRecordRef ABAddressBookCopyDefaultSource (
   ABAddressBookRef addressBook
);
Parameters
addressBook

The address book whose default source is being returned.

Return Value

The default source record.

Discussion

This is the source used when creating new records if no source is specified.

Availability
  • Available in iOS 4.0 and later.
Declared In
ABSource.h

ABAddressBookGetSourceWithRecordID

Returns the source record with the given record ID.

ABRecordRef ABAddressBookGetSourceWithRecordID (
   ABAddressBookRef addressBook,
   ABRecordID sourceID
);
Parameters
addressBook

The address book in which to search for recordID.

sourceID

The record identifier to seek in addressBook.

Return Value

If found, the source record with recordID as its identifier, otherwise NULL.

Availability
  • Available in iOS 4.0 and later.
Declared In
ABSource.h

Data Types

ABSourceType

Indicates a source type. See “Source Properties.”

typedef int ABSourceType;
Availability
  • Available in iOS 4.0 and later.
Declared In
ABSource.h

Constants

Searchable Sources

Indicates that a source is searchable.

#define kABSourceTypeSearchableMask  0x01000000
Constants
kABSourceTypeSearchableMask

Indicates that a source is searchable.

Available in iOS 4.0 and later.

Declared in ABSource.h.

Source Types

These constants identify the type of a source.

enum {
   kABSourceTypeLocal       = 0x0,
   kABSourceTypeExchange    = 0x1,
   kABSourceTypeExchangeGAL = kABSourceTypeExchange | kABSourceTypeSearchableMask,
   kABSourceTypeMobileMe    = 0x2,
   kABSourceTypeLDAP        = 0x3 | kABSourceTypeSearchableMask,
   kABSourceTypeCardDAV     = 0x4,
   kABSourceTypeCardDAVSearch = kABSourceTypeCardDAV | kABSourceTypeSearchableMask,
};
typedef int ABSourceType;
Constants
kABSourceTypeLocal

Local address book database.

Available in iOS 4.0 and later.

Declared in ABSource.h.

kABSourceTypeExchange

Exchange server.

Available in iOS 4.0 and later.

Declared in ABSource.h.

kABSourceTypeExchangeGAL

Exchange Global Address List.

Available in iOS 4.0 and later.

Declared in ABSource.h.

kABSourceTypeMobileMe

MobileMe.

Available in iOS 4.0 and later.

Declared in ABSource.h.

kABSourceTypeLDAP

LDAP server.

Available in iOS 4.0 and later.

Declared in ABSource.h.

kABSourceTypeCardDAV

CardDAV server.

Available in iOS 4.0 and later.

Declared in ABSource.h.

kABSourceTypeCardDAVSearch

Searchable CardDAV server.

Available in iOS 4.0 and later.

Declared in ABSource.h.

Source Properties

These constants identify source properties.

const ABPropertyID kABSourceNameProperty;
const ABPropertyID kABSourceTypeProperty;
Constants
kABSourceNameProperty

The name of the source. Type: kABStringPropertyType.

Available in iOS 4.0 and later.

Declared in ABSource.h.

kABSourceTypeProperty

The type of the source. Type: ABSourceType

Available in iOS 4.0 and later.

Declared in ABSource.h.