iOS Developer Library

Developer

SystemConfiguration Framework Reference System Configuration Reference

Options
Deployment Target:

On This Page
Language:

System Configuration Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import SystemConfiguration

Objective-C

@import SystemConfiguration;

The SystemConfiguration programming interface provides functions you can use to get and interpret status and error codes generated as a result of calling functions of the System Configuration framework.

Functions

  • Returns an error or status code associated with the most recent function call.

    Declaration

    Swift

    func SCCopyLastError() -> Unmanaged<CFError>!

    Objective-C

    CFErrorRef SCCopyLastError ( void );

    Return Value

    The most recent status or error code generated as the result of calling a function defined by the System Configuration framework. The code is represented by a Core Foundation CFErrorRef opaque type.

    Discussion

    Call the CFErrorGetCode function on the returned object to get the underlying error-code integer. See Status and Error Codes for descriptions of these codes. For more on CFErrorRef objects, see CFError Reference.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in iOS 2.0 and later.

  • Returns an error or status code associated with the most recent function call.

    Declaration

    Swift

    func SCError() -> Int32

    Objective-C

    int SCError ( void );

    Return Value

    The most recent status or error code generated as the result of calling a function defined by the System Configuration framework. See Status and Error Codes for descriptions of these codes.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in iOS 2.0 and later.

  • Returns a string describing the specified status code or error code.

    Declaration

    Swift

    func SCErrorString(_ status: Int32) -> UnsafePointer<Int8>

    Objective-C

    const char * SCErrorString ( int status );

    Parameters

    status

    A status or error code described in Status and Error Codes. You typically get this code by calling SCError or SCCopyLastError.

    Return Value

    The message string associated with the status or error identified by status.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in iOS 2.0 and later.

Constants

  • The status or error code generated by the most recent System Configuration function call.

    Declaration

    Objective-C

    enum { kSCStatusOK = 0, kSCStatusFailed = 1001, kSCStatusInvalidArgument = 1002, kSCStatusAccessError = 1003, kSCStatusNoKey = 1004, kSCStatusKeyExists = 1005, kSCStatusLocked = 1006, kSCStatusNeedLock = 1007, kSCStatusNoStoreSession = 2001, kSCStatusNoStoreServer = 2002, kSCStatusNotifierActive = 2003, kSCStatusNoPrefsSession = 3001, kSCStatusPrefsBusy = 3002, kSCStatusNoConfigFile = 3003, kSCStatusNoLink = 3004, kSCStatusStale = 3005, kSCStatusMaxLink = 3006, kSCStatusReachabilityUnknown = 4001, kSCStatusConnectionNoService = 5001 };

    Constants

    • kSCStatusOK

      kSCStatusOK

      The call was successful.

      Available in iOS 2.0 and later.

    • kSCStatusFailed

      kSCStatusFailed

      A nonspecific failure occurred.

      Available in iOS 2.0 and later.

    • kSCStatusInvalidArgument

      kSCStatusInvalidArgument

      An invalid argument was specified.

      Available in iOS 2.0 and later.

    • kSCStatusAccessError

      kSCStatusAccessError

      Permission is denied; you must be root to obtain a lock. As a result, the function could not create or access preferences.

      Available in iOS 2.0 and later.

    • kSCStatusNoKey

      kSCStatusNoKey

      No such key.

      Available in iOS 2.0 and later.

    • kSCStatusKeyExists

      kSCStatusKeyExists

      The key is already defined.

      Available in iOS 2.0 and later.

    • kSCStatusLocked

      kSCStatusLocked

      A lock is already held.

      Available in iOS 2.0 and later.

    • kSCStatusNeedLock

      kSCStatusNeedLock

      A lock is required for this operation.

      Available in iOS 2.0 and later.

    • kSCStatusNoStoreSession

      kSCStatusNoStoreSession

      The configuration daemon session is not active.

      Available in iOS 2.0 and later.

    • kSCStatusNoStoreServer

      kSCStatusNoStoreServer

      The configuration daemon is not available or no longer available.

      Available in iOS 2.0 and later.

    • kSCStatusNotifierActive

      kSCStatusNotifierActive

      Notifier is currently active.

      Available in iOS 2.0 and later.

    • kSCStatusNoPrefsSession

      kSCStatusNoPrefsSession

      The preferences session is not active.

      Available in iOS 2.0 and later.

    • kSCStatusPrefsBusy

      kSCStatusPrefsBusy

      A preferences update is currently in progress.

      Available in iOS 2.0 and later.

    • kSCStatusNoConfigFile

      kSCStatusNoConfigFile

      The configuration file cannot be found.

      Available in iOS 2.0 and later.

    • kSCStatusNoLink

      kSCStatusNoLink

      No such link exists.

      Available in iOS 2.0 and later.

    • kSCStatusStale

      kSCStatusStale

      A write was attempted on a stale version of the object.

      Available in iOS 2.0 and later.

    • kSCStatusMaxLink

      kSCStatusMaxLink

      The maximum link count is exceeded.

      Available in iOS 2.0 and later.

    • kSCStatusReachabilityUnknown

      kSCStatusReachabilityUnknown

      Network reachability cannot be determined.

      Available in iOS 2.0 and later.

    • kSCStatusConnectionNoService

      kSCStatusConnectionNoService

      Network service for the connection is not available.

      Available in iOS 2.0 and later.

  • The error domain associated with errors reported by the System Configuration framework.

    Declaration

    Swift

    let kCFErrorDomainSystemConfiguration: CFString!

    Objective-C

    const CFStringRef kCFErrorDomainSystemConfiguration;

    Constants

    • kCFErrorDomainSystemConfiguration

      kCFErrorDomainSystemConfiguration

      A string constant identifying a Core Foundation error domain. See CFError Reference for further information on error domains.

      Available in iOS 2.0 and later.