MPMediaLibrary Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/MediaPlayer.framework |
| Availability | Available in iOS 3.0 and later. |
| Companion guide | |
| Declared in | MPMediaLibrary.h |
Overview
An MPMediaLibrary object, or media library, represents the state of the set of synced media items (such as songs) on a device. The complete library of media items itself is called the iPod library.
A user may sync their device, changing the content of the iPod library, while your application is running. You can use the notification provided by this class to ensure that your application’s cache of the iPod library is up-to-date.
To retrieve media items from the iPod library, build a custom query as described in MPMediaPropertyPredicate Class Reference and MPMediaQuery Class Reference.
Properties
lastModifiedDate
The calendar date on which a media library was last modified.
Availability
- Available in iOS 3.0 and later.
Declared In
MPMediaLibrary.hClass Methods
defaultMediaLibrary
Gets an instance of the default media library.
Availability
- Available in iOS 3.0 and later.
Declared In
MPMediaLibrary.hInstance Methods
beginGeneratingLibraryChangeNotifications
Asks a media library to turn on notifications for device-to-computer synchronizations.
Discussion
This method is nestable—that is, you can call it multiple times. To turn off notifications, you must call endGeneratingLibraryChangeNotifications the same number of times that you called beginGeneratingLibraryChangeNotifications.
Availability
- Available in iOS 3.0 and later.
Declared In
MPMediaLibrary.hNotifications
MPMediaLibraryDidChangeNotification
MPMediaLibraryDidChangeNotification is posted, your application should reevaluate items or playlists that you previously cached.Availability
- Available in iOS 3.0 and later.
Declared In
MPMediaLibrary.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-10-19)