NSMetadataItem Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in OS X v10.4 and later. |
| Declared in | NSMetadata.h |
| Companion guides | |
Overview
The NSMetadataItem class represents the metadata associated with a file, providing a simple interface to retrieve the available attribute names and values.
Adopted Protocols
Instance Methods
attributes
Returns an array containing the attribute names of the receiver’s values.
Return Value
An array containing the attribute names of the receiver’s values. See the "Constants” section for a list of possible keys.
Availability
- Available in OS X v10.4 and later.
Declared In
NSMetadata.hvalueForAttribute:
Returns the receiver’s metadata attribute name specified by a given key.
Parameters
- key
The name of a metadata attribute. See the "Constants” section for a list of possible keys.
Return Value
The receiver’s metadata attribute name specified by key.
Availability
- Available in OS X v10.4 and later.
Declared In
NSMetadata.hvaluesForAttributes:
Returns a dictionary containing the key-value pairs for the attribute names specified by a given array of keys.
Parameters
- keys
An array containing
NSStringobjects that specify the names of a metadata attributes. See the "Constants” section for a list of possible keys.
Return Value
A dictionary containing the key-value pairs for the attribute names specified by keys.
Availability
- Available in OS X v10.4 and later.
Declared In
NSMetadata.hConstants
Attribute Keys
Attribute keys that may be associated with an item.
NSString * const NSMetadataItemFSNameKey; NSString * const NSMetadataItemDisplayNameKey; NSString * const NSMetadataItemURLKey; NSString * const NSMetadataItemPathKey; NSString * const NSMetadataItemFSSizeKey; NSString * const NSMetadataItemFSCreationDateKey; NSString * const NSMetadataItemFSContentChangeDateKey;
Constants
NSMetadataItemFSNameKeyThe value is an
NSStringobject with the name of the item as seen in the file system.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataItemDisplayNameKeyThe value is an
NSStringobject with the display name of the item, which may be different then the file system name.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataItemURLKeyThe value is an
NSURLobject that you can use to open the file.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataItemPathKeyThe value is an
NSStringobject that contains the full path to the fileAvailable in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataItemFSSizeKeyThe value is an
NSNumberobject that indicates the size (in bytes) of the file on disk.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataItemFSCreationDateKeyThe value is an
NSDateobject that contains the date and time that the file was created.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataItemFSContentChangeDateKeyThe value is an
NSDateobject that contains the date and time that the file contents last changed.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.
Cloud Storage Keys
Attribute keys that describe cloud-related information about the item.
NSString * const NSMetadataItemIsUbiquitousKey; NSString * const NSMetadataUbiquitousItemHasUnresolvedConflictsKey; NSString * const NSMetadataUbiquitousItemIsDownloadedKey; NSString * const NSMetadataUbiquitousItemIsDownloadingKey; NSString * const NSMetadataUbiquitousItemIsUploadedKey; NSString * const NSMetadataUbiquitousItemIsUploadingKey; NSString * const NSMetadataUbiquitousItemPercentDownloadedKey; NSString * const NSMetadataUbiquitousItemPercentUploadedKey;
Constants
NSMetadataItemIsUbiquitousKeyThe value is an
NSNumberobject that contains a Boolean indicating whether the item is stored in the cloud.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataUbiquitousItemHasUnresolvedConflictsKeyThe value is an
NSNumberobject that contains a Boolean indicating whether the item is currently in conflict with another version of the file somewhere else.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataUbiquitousItemIsDownloadedKeyThe value is an
NSNumberobject that contains a Boolean indicating whether the current version of the item has been downloaded and is available locally.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataUbiquitousItemIsDownloadingKeyThe value is an
NSNumberobject that contains a Boolean indicating whether the item is currently being downloaded to the local device.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataUbiquitousItemIsUploadedKeyThe value is an
NSNumberobject that contains a Boolean indicating whether the item has been uploaded to the cloud.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataUbiquitousItemIsUploadingKeyThe value is an
NSNumberobject that contains a Boolean indicating whether the current version of the item is currently being uploaded to the cloud.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataUbiquitousItemPercentDownloadedKeyThe value is an
NSNumberobject that contains the percentage of the file that has already been downloaded from the cloud. The value is a double in the range0.0to100.0.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.NSMetadataUbiquitousItemPercentUploadedKeyThe value is an
NSNumberobject that contains the percentage of the file that has already been uploaded to the cloud. The value is a double in the range0.0to100.0.Available in OS X v10.7 and later.
Declared in
NSMetadata.h.
© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)