Mac Developer Library

Developer

Accounts Framework Reference ACAccount Class Reference

Options
Deployment Target:

On This Page
Language:

ACAccount

An ACAccount object encapsulates information about a user account stored in the Accounts database. You can create and retrieve accounts using an ACAccountStore object. The ACAccountStore object provides an interface to the persistent Accounts database. For each user, all account objects belong to a single ACAccountStore object.

Inheritance


Conforms To


Import Statement


Swift

import Accounts

Objective-C

@import Accounts;

Availability


Available in OS X v10.8 and later.
  • Initializes a new account of the specified type.

    Declaration

    Swift

    init!(accountType type: ACAccountType!)

    Objective-C

    - (instancetype)initWithAccountType:(ACAccountType *)type

    Parameters

    type

    The type of this account.

    Return Value

    The newly initialized account.

    Import Statement

    Objective-C

    @import Accounts;

    Swift

    import Accounts

    Availability

    Available in OS X v10.8 and later.

    See Also

    accountType

  • A human-readable description of the account.

    Declaration

    Swift

    var accountDescription: String!

    Objective-C

    @property(copy, atomic) NSString *accountDescription

    Discussion

    This property is available if the user grants the application access to this account; otherwise it is nil.

    Import Statement

    Objective-C

    @import Accounts;

    Swift

    import Accounts

    Availability

    Available in OS X v10.8 and later.

  • The type of service account.

    Declaration

    Swift

    var accountType: ACAccountType!

    Objective-C

    @property(strong, atomic) ACAccountType *accountType

    Discussion

    This property is required. You specify the account type using the initWithAccountType: method. You can use the accountsWithAccountType: method to retrieve all accounts of a particular type.

    Import Statement

    Objective-C

    @import Accounts;

    Swift

    import Accounts

    Availability

    Available in OS X v10.8 and later.

  • The credential used to authenticate the user of this account.

    Declaration

    Swift

    var credential: ACAccountCredential!

    Objective-C

    @property(strong, atomic) ACAccountCredential *credential

    Discussion

    This property is required and must be set before the account is saved. For privacy reasons, this property is inaccessible after the account is saved.

    Import Statement

    Objective-C

    @import Accounts;

    Swift

    import Accounts

    Availability

    Available in OS X v10.8 and later.

  • A unique identifier for this account. (read-only)

    Declaration

    Swift

    var identifier: String! { get }

    Objective-C

    @property(readonly, weak, atomic) NSString *identifier

    Discussion

    Use the accountWithIdentifier: method to get an account with the specified identifier.

    Import Statement

    Objective-C

    @import Accounts;

    Swift

    import Accounts

    Availability

    Available in OS X v10.8 and later.

  • username username Property

    The username for this account.

    Declaration

    Swift

    var username: String!

    Objective-C

    @property(copy, atomic) NSString *username

    Discussion

    This property must be set before the account is saved. After the account is saved, this property is available if the user grants the application access to this account; otherwise it is nil.

    Import Statement

    Objective-C

    @import Accounts;

    Swift

    import Accounts

    Availability

    Available in OS X v10.8 and later.