Class

MPMediaItemCollection

A sorted set of media items from the media library.

Declaration

@interface MPMediaItemCollection : MPMediaEntity

Overview

Typically, you use this class by requesting an array of collections from a media query by way of its collections property. Media queries are described in MPMediaQuery.

The grouping type for the media query determines the arrangement of the media items you obtain. You also use the media query collections property to obtain synced playlists, as described in MPMediaPlaylist.

A media item collection can have a wide range of metadata associated with it. You access this metadata using the valueForProperty: method along with the property keys described in this document. You can also access metadata in a batch fashion using the enumerateValuesForProperties:usingBlock: method. In some cases, this is more efficient. Both of these methods are defined in MPMediaEntity (the abstract superclass of MPMediaItemCollection) and described in MPMediaEntity.

Topics

Creating a Media Item Collection

+ collectionWithItems:

Creates a media item collection by copying an array of media items.

- initWithItems:

Initializes a media item collection with an array of media items.

Using a Media Item Collection

items

The media items in a media item collection.

representativeItem

A media item whose properties are representative of the other media items in a collection.

count

The number of media items in a collection.

mediaTypes

The types of the media items in a collection.

Relationships

Inherits From

See Also

Media Items and Playlists

MPMediaItem

A collection of properties that represents a single item contained in the media library.

MPMediaItemArtwork

A graphical image, such as music album cover art, associated with a media item.

MPMediaPlaylist

A playable collection of related media items.

MPMediaPlaylistCreationMetadata

A set of attributes used to describe a playlist when the playlist is first created.

MPMediaEntity

The abstract superclass for media items, media item collections, and media playlist instances.