Mac Developer Library

Developer

CoreServices Framework Reference Metadata Schema Reference

Options
Deployment Target:

On This Page
Language:

Metadata Schema Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import CoreServices

Objective-C

@import CoreServices;

The MDSchema functions provide information about the metadata returned for an item including the type of metadata provided for a file type, the localized display name for a metadata attribute key, and the schema for a metadata attribute key.

Functions

  • Returns an array containing all the metadata attributes defined in the schema.

    Declaration

    Swift

    func MDSchemaCopyAllAttributes() -> CFArray!

    Objective-C

    CFArrayRef MDSchemaCopyAllAttributes ( void );

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 or later.

  • Returns a dictionary containing the metadata attributes for the specified UTI type.

    Declaration

    Swift

    func MDSchemaCopyAttributesForContentType(_ utiType: CFString!) -> CFDictionary!

    Objective-C

    CFDictionaryRef MDSchemaCopyAttributesForContentType ( CFStringRef contentTypeUTI );

    Parameters

    utiType

    The UTI type.

    Return Value

    A dictionary containing kMDAttributeDisplayValues and kMDAttributeAllValues keys. Returns NULL if the UTI type is unknown.

    Discussion

    This function returns the metadata attributes for the specified UTI type only.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 or later.

  • Returns the localized description of a metadata attribute key.

    Declaration

    Swift

    func MDSchemaCopyDisplayDescriptionForAttribute(_ name: CFString!) -> CFString!

    Objective-C

    CFStringRef MDSchemaCopyDisplayDescriptionForAttribute ( CFStringRef name );

    Parameters

    name

    The name of the metadata attribute key.

    Return Value

    The localized description of the metadata attribute, or NULL if no localized description is available.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 or later.

  • Returns the localized display name of a metadata attribute key.

    Declaration

    Swift

    func MDSchemaCopyDisplayNameForAttribute(_ name: CFString!) -> CFString!

    Objective-C

    CFStringRef MDSchemaCopyDisplayNameForAttribute ( CFStringRef name );

    Parameters

    name

    The name of the metadata attribute key.

    Return Value

    The localized display name of the metadata attribute, or NULL if no localized display name is available.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 or later.

  • Returns a dictionary describing the values for the specified metadata attribute key.

    Declaration

    Swift

    func MDSchemaCopyMetaAttributesForAttribute(_ name: CFString!) -> CFDictionary!

    Objective-C

    CFDictionaryRef MDSchemaCopyMetaAttributesForAttribute ( CFStringRef name );

    Parameters

    name

    The name of the metadata attribute key.

    Return Value

    A dictionary describing the schema of the metadata attribute key.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 or later.

Constants

  • Specify the available metadata attribute keys for a content type.

    Declaration

    Swift

    let kMDAttributeDisplayValues: CFString! let kMDAttributeAllValues: CFString! let kMDAttributeReadOnlyValues: CFString! let kMDExporterAvaliable: CFString!

    Objective-C

    const CFStringRef kMDAttributeDisplayValues; const CFStringRef kMDAttributeAllValues; const CFStringRef kMDAttributeReadOnlyValues; const CFStringRef kMDExporterAvaliable;

    Constants

    • kMDAttributeDisplayValues

      kMDAttributeDisplayValues

      An array of strings containing the available display metadata attribute keys, or NULL if the type is not known by the system.

      Available in OS X v10.4 and later.

    • kMDAttributeAllValues

      kMDAttributeAllValues

      An array of strings containing the available metadata attribute keys, or NULL if the type is not known by the system.

      Available in OS X v10.4 and later.

    • kMDAttributeReadOnlyValues

      kMDAttributeReadOnlyValues

      An array of strings containing the read-only metadata attribute keys, or NULL if the type is not known by the system.

      Available in OS X v10.5 and later.

    • kMDExporterAvaliable

      kMDExporterAvaliable

      A CFBoolean that indicates if an exporter is available for this UTI type.

      Available in OS X v10.5 and later.

    Discussion

    These keys are in the dictionary returned by the function MDSchemaCopyAttributesForContentType.

  • Specify the schema of a metadata attribute key.

    Declaration

    Swift

    let kMDAttributeName: CFString! let kMDAttributeType: CFString! let kMDAttributeMultiValued: CFString!

    Objective-C

    const CFStringRef kMDAttributeName; const CFStringRef kMDAttributeType; const CFStringRef kMDAttributeMultiValued;

    Constants

    • kMDAttributeName

      kMDAttributeName

      A string containing the name of the metadata attribute key.

      Available in OS X v10.4 and later.

    • kMDAttributeType

      kMDAttributeType

      A CFNumberRef or CFTypeId describing the type of data returned as the value of the metadata attribute key.

      Available in OS X v10.4 and later.

    • kMDAttributeMultiValued

      kMDAttributeMultiValued

      A boolean that indicates if the metadata attribute value is multi-valued. If this is TRUE, the metadata attribute value is an array of the types specified in kMDAttributeType.

      Available in OS X v10.4 and later.

    Discussion

    These keys are in the dictionary returned by the function MDSchemaCopyMetaAttributesForAttribute.