Type Method

metadataItemsFromArray:withKey:keySpace:

Provides an array of metadata items that match a specified key or key space.

Declaration

+ (NSArray<AVMetadataItem *> *)metadataItemsFromArray:(NSArray<AVMetadataItem *> *)metadataItems withKey:(id)key keySpace:(AVMetadataKeySpace)keySpace;

Parameters

array

The array of AVMetadataItem objects to be filtered.

key

The key that must be matched for a metadata item to be included in the output array. The key is compared to the keys in the metadata in the array using isEqual:.

If you do not want to filter by key, pass nil.

keySpace

The key space that must be matched for a metadata item to be included in the output array. The key space is compared to the key spaces in the metadata in the array using isEqualToString:.

If you do not want to filter by key space, pass nil.

Return Value

An array of the metadata items from array that match key or keySpace.

Discussion

If the value in the keySpace parameter is AVMetadataKeySpaceCommon, the value of the metadata item’s commonKey property must match the value in the key parameter for the item to be returned. If the key parameter is nil, then all metadata items in the common key space are returned.

If the value in the keySpace parameter is nil or is not the constant for the common key space, the value of the metadata item’s key property must match the value in the key parameter for the item to be returned. If the key parameter itself is nil, then all metadata items in the specified key space are returned.

See Also

Filtering Arrays of Metadata Items

AVMetadataKeySpace

A value that defines a metadata key space.

+ metadataItemsFromArray:withLocale:

Provides an array of metadata items that match a specified locale.

+ metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:

Provides the subset of metadata items whose locales match one of the specified language identifiers.

+ metadataItemsFromArray:filteredByMetadataItemFilter:

Filters an array of metadata items using the metadata item filter.

+ metadataItemsFromArray:filteredByIdentifier:

Filters an array of metadata items according to the supplied identifier.

AVMetadataIdentifier

A value that defines the metadata identifiers for different file formats.