Mac Developer Library

Developer

AppKit Framework Reference AppKit Constants Reference

Options
Deployment Target:

On This Page
Language:

AppKit Constants Reference

This document describes the constants defined in the Application Kit framework that are not defined in, or are not described in, a document for an individual class.

See AppKit Data Types Reference for descriptions of other constants defined in enumerations.

Constants

Global Variables

  • Color-space names designate predefined color spaces.

    Declaration

    Swift

    var NSCalibratedWhiteColorSpace: NSString! var NSCalibratedRGBColorSpace: NSString! var NSDeviceWhiteColorSpace: NSString! var NSDeviceRGBColorSpace: NSString! var NSDeviceCMYKColorSpace: NSString! var NSNamedColorSpace: NSString! var NSPatternColorSpace: NSString! var NSCustomColorSpace: NSString!

    Objective-C

    NSString *NSCalibratedWhiteColorSpace; NSString *NSCalibratedBlackColorSpace; NSString *NSCalibratedRGBColorSpace; NSString *NSDeviceWhiteColorSpace; NSString *NSDeviceBlackColorSpace; NSString *NSDeviceRGBColorSpace; NSString *NSDeviceCMYKColorSpace; NSString *NSNamedColorSpace; NSString *NSPatternColorSpace; NSString *NSCustomColorSpace;

    Constants

    • NSCalibratedWhiteColorSpace

      NSCalibratedWhiteColorSpace

      Calibrated color space with white and alpha components (pure white is 1.0)

      Available in OS X v10.0 and later.

    • NSCalibratedBlackColorSpace

      NSCalibratedBlackColorSpace

      Calibrated color space with black and alpha components (pure black is 1.0)

      Available in OS X v10.0 and later.

      Deprecated in OS X v10.6.

    • NSCalibratedRGBColorSpace

      NSCalibratedRGBColorSpace

      Calibrated color space with red, green, blue, and alpha components.

      You can also create a color with HSB (hue, saturation, brightness) and alpha components and can extract these components.

      Available in OS X v10.0 and later.

    • NSDeviceWhiteColorSpace

      NSDeviceWhiteColorSpace

      Device-dependent color space with white and alpha components (pure white is 1.0)

      Available in OS X v10.0 and later.

    • NSDeviceBlackColorSpace

      NSDeviceBlackColorSpace

      Device-dependent color space with black and alpha components (pure black is 1.0)

      Available in OS X v10.0 and later.

      Deprecated in OS X v10.6.

    • NSDeviceRGBColorSpace

      NSDeviceRGBColorSpace

      Device-dependent color space with red, green, blue, and alpha components.

      You can also create a color with HSB (hue, saturation, brightness) and alpha components and can extract these components.

      Available in OS X v10.0 and later.

    • NSDeviceCMYKColorSpace

      NSDeviceCMYKColorSpace

      Device-dependent color space with cyan, magenta, yellow, black, and alpha components

      Available in OS X v10.0 and later.

    • NSNamedColorSpace

      NSNamedColorSpace

      Catalog name and color name components

      The components of this color space are indexes into lists or catalogs of prepared colors. The catalogs of named colors come with lookup tables that are able to generate the correct color on a given device.

      Available in OS X v10.0 and later.

    • NSPatternColorSpace

      NSPatternColorSpace

      Pattern image (tiled)

      Identifies a pattern color space, which is simply an image that is repeated over and over again in a tiled pattern.

      Available in OS X v10.0 and later.

    • NSCustomColorSpace

      NSCustomColorSpace

      Custom NSColorSpace object and floating-point components describing a color in that space

      A custom color-space object represents a color space that is not necessarily predefined by the Application Kit. See “Working With Color Spaces” for information on creating custom color-space objects.

      Available in OS X v10.0 and later.

    Discussion

    You can use a color-space name in certain methods of NSColor that create or convert color objects. The name identifies the color space to be used for the operation.

  • These constants are the standard gray values for the 2-bit deep grayscale color space.

    Declaration

    Swift

    let NSWhite: CGFloat let NSLightGray: CGFloat let NSDarkGray: CGFloat let NSBlack: CGFloat

    Objective-C

    const float NSWhite; const float NSLightGray; const float NSDarkGray; const float NSBlack;

    Constants

    • NSWhite

      NSWhite

      A constant that specifies the white shade in the 2-bit deep grayscale color space.

      Available in OS X v10.0 and later.

    • NSLightGray

      NSLightGray

      A constant that specifies the light gray shade in the 2-bit deep grayscale color space.

      Available in OS X v10.0 and later.

    • NSDarkGray

      NSDarkGray

      A constant that specifies the dark gray shade in the 2-bit deep grayscale color space.

      Available in OS X v10.0 and later.

    • NSBlack

      NSBlack

      A constant that specifies the black shade in the 2-bit deep grayscale color space.

      Available in OS X v10.0 and later.

  • NSInterfaceStyleDefault can be used to override the platform’s default interface style.

    Declaration

    Objective-C

    NSString *NSInterfaceStyleDefault;

    Constants

    • NSInterfaceStyleDefault

      NSInterfaceStyleDefault

      For more information, see the function NSInterfaceStyleForKey.

      Available in OS X v10.0 and later.

      Deprecated in OS X v10.8.

  • Type qualifiers used by Interface Builder to synchronize with Xcode. For more information, see Communicating With Objects in Cocoa Fundamentals Guide.

    Declaration

    Objective-C

    #define IBAction void #define IBOutlet

    Constants

    • IBAction

      IBAction

      Type qualifier used by Interface Builder to synchronize actions added programmatically with its internal list of action methods defined for a project.

      Available in OS X v10.0 through OS X v10.5.

    • IBOutlet

      IBOutlet

      Identifier used to qualify an instance-variable declaration so that Interface Builder can synchronize the display and connection of outlets with Xcode.

      Available in OS X v10.0 through OS X v10.5.

  • Obsolete constant values. Do not use.

    Declaration

    Objective-C

    NSSize NSIconSize; NSSize NSTokenSize;

    Constants

    • NSIconSize

      NSIconSize

      Obsolete constant values. Do not use.

      Available in OS X v10.0 through OS X v10.3.

      Not available to 64-bit applications.

    • NSTokenSize

      NSTokenSize

      Obsolete constant values. Do not use.

      Available in OS X v10.0 through OS X v10.3.

      Not available to 64-bit applications.

Errors

  • These constants represent errors generated by NSAttributedString.

    Declaration

    Swift

    var NSTextReadInapplicableDocumentTypeError: Int { get } var NSTextWriteInapplicableDocumentTypeError: Int { get } var NSTextReadWriteErrorMinimum: Int { get } var NSTextReadWriteErrorMaximum: Int { get }

    Objective-C

    enum { NSTextReadInapplicableDocumentTypeError = 65806, NSTextWriteInapplicableDocumentTypeError = 66062, NSTextReadWriteErrorMinimum = 65792, NSTextReadWriteErrorMaximum = 66303 };

    Constants

    • NSTextReadInapplicableDocumentTypeError

      NSTextReadInapplicableDocumentTypeError

      Indicates a problem reading data with the specified format.

      Available in OS X v10.4 and later.

    • NSTextWriteInapplicableDocumentTypeError

      NSTextWriteInapplicableDocumentTypeError

      Indicates a problem writing data of the specified format.

      Available in OS X v10.4 and later.

    • NSTextReadWriteErrorMinimum

      NSTextReadWriteErrorMinimum

      The beginning of a range of error codes reserved for future use.

      Available in OS X v10.4 and later.

    • NSTextReadWriteErrorMaximum

      NSTextReadWriteErrorMaximum

      The end of a range of error codes reserved for future use.

      Available in OS X v10.4 and later.

    Discussion

    These constants are returned in an NSError object.

  • These constants represent errors returned by application services.

    Declaration

    Swift

    var NSServiceApplicationNotFoundError: Int { get } var NSServiceApplicationLaunchFailedError: Int { get } var NSServiceRequestTimedOutError: Int { get } var NSServiceInvalidPasteboardDataError: Int { get } var NSServiceMalformedServiceDictionaryError: Int { get } var NSServiceMiscellaneousError: Int { get } var NSServiceErrorMinimum: Int { get } var NSServiceErrorMaximum: Int { get }

    Objective-C

    enum { NSServiceApplicationNotFoundError = 66560, NSServiceApplicationLaunchFailedError = 66561, NSServiceRequestTimedOutError = 66562, NSServiceInvalidPasteboardDataError = 66563, NSServiceMalformedServiceDictionaryError = 66564, NSServiceMiscellaneousError = 66800, NSServiceErrorMinimum = 66560, NSServiceErrorMaximum = 66817 };

    Constants

    • NSServiceApplicationNotFoundError

      NSServiceApplicationNotFoundError

      The service provider could not be found.

      Available in OS X v10.5 and later.

    • NSServiceApplicationLaunchFailedError

      NSServiceApplicationLaunchFailedError

      The service providing application could not be launched. This will typically contain an underlying error with an Launch Services error code.

      Available in OS X v10.5 and later.

    • NSServiceRequestTimedOutError

      NSServiceRequestTimedOutError

      The service providing application did not open its service listening port in time, or the app didn't respond to the request in time; see the Console log to figure out which (the errors are typically reported the same way to the user).

      Available in OS X v10.5 and later.

    • NSServiceInvalidPasteboardDataError

      NSServiceInvalidPasteboardDataError

      The service providing app did not return a pasteboard with any of the promised types, or we couldn't write the data from the pasteboard to the object receiving the returned data.

      Available in OS X v10.5 and later.

    • NSServiceMalformedServiceDictionaryError

      NSServiceMalformedServiceDictionaryError

      The service dictionary did not contain the necessary keys. Messages will typically be logged to the console giving more details.

      Available in OS X v10.5 and later.

    • NSServiceMiscellaneousError

      NSServiceMiscellaneousError

      Other errors, representing programmatic mistakes in the service consuming application. These show a generic error message to the user.

      Available in OS X v10.5 and later.

    • NSServiceErrorMinimum

      NSServiceErrorMinimum

      Inclusive service error range, for checking future error codes.

      Available in OS X v10.5 and later.

    • NSServiceErrorMaximum

      NSServiceErrorMaximum

      Inclusive service error range, for checking future error codes.

      Available in OS X v10.5 and later.

Exceptions

  • These constants name the exceptions that the Application Kit can raise.

    Declaration

    Swift

    var NSTextLineTooLongException: NSString! var NSTextNoSelectionException: NSString! var NSWordTablesWriteException: NSString! var NSWordTablesReadException: NSString! var NSTextReadException: NSString! var NSTextWriteException: NSString! var NSPasteboardCommunicationException: NSString! var NSPrintingCommunicationException: NSString! var NSAbortModalException: NSString! var NSAbortPrintingException: NSString! var NSIllegalSelectorException: NSString! var NSAppKitVirtualMemoryException: NSString! var NSBadRTFDirectiveException: NSString! var NSBadRTFFontTableException: NSString! var NSBadRTFStyleSheetException: NSString! var NSTypedStreamVersionException: NSString! var NSTIFFException: NSString! var NSPrintPackageException: NSString! var NSBadRTFColorTableException: NSString! var NSDraggingException: NSString! var NSColorListIOException: NSString! var NSColorListNotEditableException: NSString! var NSBadBitmapParametersException: NSString! var NSWindowServerCommunicationException: NSString! var NSFontUnavailableException: NSString! var NSPPDIncludeNotFoundException: NSString! var NSPPDParseException: NSString! var NSPPDIncludeStackOverflowException: NSString! var NSPPDIncludeStackUnderflowException: NSString! var NSRTFPropertyStackOverflowException: NSString! var NSAppKitIgnoredException: NSString! var NSBadComparisonException: NSString! var NSImageCacheException: NSString! var NSNibLoadingException: NSString! var NSBrowserIllegalDelegateException: NSString! var NSAccessibilityException: NSString!

    Objective-C

    NSString *NSTextLineTooLongException; NSString *NSTextNoSelectionException; NSString *NSWordTablesWriteException; NSString *NSWordTablesReadException; NSString *NSTextReadException; NSString *NSTextWriteException; NSString *NSPasteboardCommunicationException; NSString *NSPrintingCommunicationException; NSString *NSAbortModalException; NSString *NSAbortPrintingException; NSString *NSIllegalSelectorException; NSString *NSAppKitVirtualMemoryException; NSString *NSBadRTFDirectiveException; NSString *NSBadRTFFontTableException; NSString *NSBadRTFStyleSheetException; NSString *NSTypedStreamVersionException; NSString *NSTIFFException; NSString *NSPrintPackageException; NSString *NSBadRTFColorTableException; NSString *NSDraggingException; NSString *NSColorListIOException; NSString *NSColorListNotEditableException; NSString *NSBadBitmapParametersException; NSString *NSWindowServerCommunicationException; NSString *NSFontUnavailableException; NSString *NSPPDIncludeNotFoundException; NSString *NSPPDParseException; NSString *NSPPDIncludeStackOverflowException; NSString *NSPPDIncludeStackUnderflowException; NSString *NSRTFPropertyStackOverflowException; NSString *NSAppKitIgnoredException; NSString *NSBadComparisonException; NSString *NSImageCacheException; NSString *NSNibLoadingException; NSString *NSBrowserIllegalDelegateException; NSString *NSAccessibilityException;

    Constants

    • NSTextLineTooLongException

      NSTextLineTooLongException

      Exception generated if a line is too long in a NSText object.

      Available in OS X v10.0 and later.

    • NSTextNoSelectionException

      NSTextNoSelectionException

      Available in OS X v10.0 and later.

    • NSWordTablesWriteException

      NSWordTablesWriteException

      Available in OS X v10.0 and later.

    • NSWordTablesReadException

      NSWordTablesReadException

      Available in OS X v10.0 and later.

    • NSTextReadException

      NSTextReadException

      Available in OS X v10.0 and later.

    • NSTextWriteException

      NSTextWriteException

      Available in OS X v10.0 and later.

    • NSPasteboardCommunicationException

      NSPasteboardCommunicationException

      Available in OS X v10.0 and later.

    • NSPrintingCommunicationException

      NSPrintingCommunicationException

      Available in OS X v10.0 and later.

    • NSAbortModalException

      NSAbortModalException

      Available in OS X v10.0 and later.

    • NSAbortPrintingException

      NSAbortPrintingException

      Available in OS X v10.0 and later.

    • NSIllegalSelectorException

      NSIllegalSelectorException

      Available in OS X v10.0 and later.

    • NSAppKitVirtualMemoryException

      NSAppKitVirtualMemoryException

      Available in OS X v10.0 and later.

    • NSBadRTFDirectiveException

      NSBadRTFDirectiveException

      Available in OS X v10.0 and later.

    • NSBadRTFFontTableException

      NSBadRTFFontTableException

      Available in OS X v10.0 and later.

    • NSBadRTFStyleSheetException

      NSBadRTFStyleSheetException

      Available in OS X v10.0 and later.

    • NSTypedStreamVersionException

      NSTypedStreamVersionException

      Available in OS X v10.0 and later.

    • NSTIFFException

      NSTIFFException

      Available in OS X v10.0 and later.

    • NSPrintPackageException

      NSPrintPackageException

      Available in OS X v10.0 and later.

    • NSBadRTFColorTableException

      NSBadRTFColorTableException

      Available in OS X v10.0 and later.

    • NSDraggingException

      NSDraggingException

      Available in OS X v10.0 and later.

    • NSColorListIOException

      NSColorListIOException

      Available in OS X v10.0 and later.

    • NSColorListNotEditableException

      NSColorListNotEditableException

      Available in OS X v10.0 and later.

    • NSBadBitmapParametersException

      NSBadBitmapParametersException

      Available in OS X v10.0 and later.

    • NSWindowServerCommunicationException

      NSWindowServerCommunicationException

      Available in OS X v10.0 and later.

    • NSFontUnavailableException

      NSFontUnavailableException

      Available in OS X v10.0 and later.

    • NSPPDIncludeNotFoundException

      NSPPDIncludeNotFoundException

      Available in OS X v10.0 and later.

    • NSPPDParseException

      NSPPDParseException

      Available in OS X v10.0 and later.

    • NSPPDIncludeStackOverflowException

      NSPPDIncludeStackOverflowException

      Available in OS X v10.0 and later.

    • NSPPDIncludeStackUnderflowException

      NSPPDIncludeStackUnderflowException

      Available in OS X v10.0 and later.

    • NSRTFPropertyStackOverflowException

      NSRTFPropertyStackOverflowException

      Available in OS X v10.0 and later.

    • NSAppKitIgnoredException

      NSAppKitIgnoredException

      Available in OS X v10.0 and later.

    • NSBadComparisonException

      NSBadComparisonException

      Available in OS X v10.0 and later.

    • NSImageCacheException

      NSImageCacheException

      Available in OS X v10.0 and later.

    • NSNibLoadingException

      NSNibLoadingException

      Available in OS X v10.0 and later.

    • NSBrowserIllegalDelegateException

      NSBrowserIllegalDelegateException

      Available in OS X v10.0 and later.

    • NSAccessibilityException

      NSAccessibilityException

      Available in OS X v10.2 and later.