Instance Method

initWithFilterPredicates:

Initializes a media query with a set of media property predicates.

Declaration

- (instancetype)initWithFilterPredicates:(NSSet<MPMediaPredicate *> *)filterPredicates;

Parameters

filterPredicates

The set of media property predicates to use as a filter on the library.

Return Value

An initialized media query.

Discussion

MPMediaPropertyPredicate describes how to create media property predicates. The General Media Item Property Keys and Podcast Item Property Keys enumerations in MPMediaItem contain the keys you can use to construct predicates.

See Also

Creating Media Queries

+ albumsQuery

Creates a media query that matches music items and that groups and sorts collections by album name.

+ artistsQuery

Creates a media query that matches music items and that groups and sorts collections by artist name.

+ songsQuery

Creates a media query that matches music items and that groups and sorts collections by song name.

+ playlistsQuery

Creates a media query that matches the entire library and that groups and sorts collections by playlist name.

+ podcastsQuery

Creates a media query that matches podcast items and that groups and sorts collections by podcast name.

+ audiobooksQuery

Creates a media query that matches audio book items and that groups and sorts collections by audio book name.

+ compilationsQuery

Creates a media query that matches compilation items and that groups and sorts collections by album name.

+ composersQuery

Creates a media query that matches all media items and that groups and sorts collections by composer name.

+ genresQuery

Creates a media query that matches all media items and that groups and sorts collections by genre name.

- init

Initializes a generic media query.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software