Mac Developer Library

Developer

SMLoginItem.h Reference

Options
Deployment Target:

On This Page
Language:

SMLoginItem.h Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import ServiceManagement

Objective-C

@import ServiceManagement;

Included Headers

  • <sys/cdefs.h>

Functions

  • Enable a helper application located in the main application bundle's Contents/Library/LoginItems directory.

    Declaration

    Swift

    func SMLoginItemSetEnabled(_ identifier: CFString, _ enabled: Boolean) -> Boolean

    Objective-C

    Boolean SMLoginItemSetEnabled ( CFStringRef identifier, Boolean enabled );

    Parameters

    identifier

    The bundle identifier of the helper application bundle.

    enabled

    The Boolean enabled state of the helper application. This value is effective only for the currently logged in user. If true, the helper application will be started immediately (and upon subsequent logins) and kept running. If false, the helper application will no longer be kept running.

    Return Value

    Returns true if the requested change has taken effect.

    Import Statement

    Objective-C

    @import ServiceManagement;

    Swift

    import ServiceManagement

    Availability

    Available in OS X v10.6 and later.