iOS Developer Library

Developer

Address Book Framework Reference for iOS ABRecord Reference

Options
Deployment Target:

On This Page
Language:

ABRecord Reference

The ABRecord opaque type (whose objects are known as records) provides a common interface to the records in the Address Book database. It defines common properties for all records. A property is a field in a record such as the first or last name of a person record.

Each record in the Address Book database has a unique ID, which you obtain using the ABRecordGetRecordID function.

Functions

Data Types

  • Reference to a record.

    Declaration

    Swift

    typealias ABRecord = CFTypeRef

    Objective-C

    typedef CFTypeRef ABRecordRef;

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • Integer that identifies a record.

    Declaration

    Swift

    typealias ABRecordID = Int32

    Objective-C

    typedef int32_t ABRecordID;

    Discussion

    Valid record IDs are positive integers.

    See “Invalid Record ID”.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • Integer that identifies a record property.

    Declaration

    Swift

    typealias ABPropertyID = Int32

    Objective-C

    typedef int32_t ABPropertyID;

    Discussion

    See properties listed in Constants and Constants

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • Integer that identifies a record type.

    Declaration

    Swift

    typealias ABRecordType = UInt32

    Objective-C

    typedef uint32_t ABRecordType;

    Discussion

    See “Record Types”.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • Integer that identifies a record property type.

    Declaration

    Swift

    typealias ABPropertyType = UInt32

    Objective-C

    typedef uint16_t ABPropertyType;

    Discussion

    See “Record Property Types”.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

Constants

  • These constants identify record types.

    Declaration

    Swift

    var kABPersonType: Int { get } var kABGroupType: Int { get } var kABSourceType: Int { get }

    Objective-C

    enum { kABPersonType = 0, kABGroupType = 1, kABSourceType = 2 };

    Constants

    • kABPersonType

      kABPersonType

      Person record.

      Available in iOS 2.0 and later.

    • kABGroupType

      kABGroupType

      Group record.

      Available in iOS 2.0 and later.

    • kABSourceType

      kABSourceType

      Source record.

      Available in iOS 5.0 and later.

    Discussion

    See ABRecordType.

  • Indicates a multivalue property.

    Declaration

    Swift

    var kABMultiValueMask: Int32 { get }

    Objective-C

    #define kABMultiValueMask (1 << 8)

    Constants

    • kABMultiValueMask

      kABMultiValueMask

      Indicates a multivalue property.

      Available in iOS 2.0 and later.

  • These constants identify record property types.

    Declaration

    Swift

    var kABInvalidPropertyType: Int { get } var kABStringPropertyType: Int { get } var kABIntegerPropertyType: Int { get } var kABRealPropertyType: Int { get } var kABDateTimePropertyType: Int { get } var kABDictionaryPropertyType: Int { get } var kABMultiStringPropertyType: Int { get } var kABMultiIntegerPropertyType: Int { get } var kABMultiRealPropertyType: Int { get } var kABMultiDateTimePropertyType: Int { get } var kABMultiDictionaryPropertyType: Int { get }

    Objective-C

    enum { kABInvalidPropertyType = 0x0, kABStringPropertyType = 0x1, kABIntegerPropertyType = 0x2, kABRealPropertyType = 0x3, kABDateTimePropertyType = 0x4, kABDictionaryPropertyType = 0x5, kABMultiStringPropertyType = kABMultiValueMask | kABStringPropertyType kABMultiIntegerPropertyType = kABMultiValueMask | kABIntegerPropertyType kABMultiRealPropertyType = kABMultiValueMask | kABRealPropertyType kABMultiDateTimePropertyType = kABMultiValueMask | kABDateTimePropertyType kABMultiDictionaryPropertyType = kABMultiValueMask | kABDictionaryPropertyType };

    Constants

    • kABInvalidPropertyType

      kABInvalidPropertyType

      Invalid property.

      Available in iOS 2.0 and later.

    • kABStringPropertyType

      kABStringPropertyType

      String property. Returned as a CFStringRef object.

      Available in iOS 2.0 and later.

    • kABIntegerPropertyType

      kABIntegerPropertyType

      Integer property. Returned as a CFNumberRef object.

      Available in iOS 2.0 and later.

    • kABRealPropertyType

      kABRealPropertyType

      Real property. Returned as a CFNumberRef object.

      Available in iOS 2.0 and later.

    • kABDateTimePropertyType

      kABDateTimePropertyType

      Date-time property. Returned as a CFDateRef object.

      Available in iOS 2.0 and later.

    • kABDictionaryPropertyType

      kABDictionaryPropertyType

      Dictionary property. Returned as a CFDictionaryRef object.

      Available in iOS 2.0 and later.

    • kABMultiStringPropertyType

      kABMultiStringPropertyType

      Multistring property. Returned as an ABMultiValueRef of CFStringRef objects.

      Available in iOS 2.0 and later.

    • kABMultiIntegerPropertyType

      kABMultiIntegerPropertyType

      Multiinteger property. Returned as an ABMultiValueRef of CFNumberRef objects.

      Available in iOS 2.0 and later.

    • kABMultiRealPropertyType

      kABMultiRealPropertyType

      Multireal property. Returned as an ABMultiValueRef of CFNumberRef objects.

      Available in iOS 2.0 and later.

    • kABMultiDateTimePropertyType

      kABMultiDateTimePropertyType

      Multi–date-time property. Returned as an ABMultiValueRef of CFDateRef objects.

      Available in iOS 2.0 and later.

    • kABMultiDictionaryPropertyType

      kABMultiDictionaryPropertyType

      Multidictionary property. Returned as an ABMultiValueRef of CFDictionaryRef objects.

      Available in iOS 2.0 and later.

    Discussion

    See ABPropertyType.

  • These macros identify invalid values for record and property identifiers.

    Declaration

    Swift

    var kABRecordInvalidID: Int32 { get } var kABPropertyInvalidID: Int32 { get }

    Objective-C

    #define kABRecordInvalidID -1 #define kABPropertyInvalidID -1

    Constants

    • kABRecordInvalidID

      kABRecordInvalidID

      Records with this ID have not been saved to the Address Book database.

      Available in iOS 2.0 and later.

    • kABPropertyInvalidID

      kABPropertyInvalidID

      Indicates an invalid value for a property ID.

      Available in iOS 3.0 and later.