Instance Property location
The location of this media item if available.
Declaration @property(readonly, nonatomic, retain) * NSURL location;
If the location of this media item is not available, this property returns
ITLib Media Item Location Type Unknown
This method returns URLs that are outside of the default sandbox. In order to use the iTunesLibrary framework, a sandboxed application must have the
com .apple .security .assets .music .read-write
com .apple .security .assets .music .read-only
To access the media item file in a sandboxed app, call the
start Accessing Security Scoped Resource Listing 1
Accessing a media file from a sandboxed application
NSError * error = nil;
ITLibrary* library =
[[ITLibrary alloc] initWithAPIVersion:@"1.0" error:&error];
// Get first media item in the library
NSArray * mediaItems = library.allMediaItems;
if (mediaItems.count > 0)
// Get the location (URL) of the first media item and
// prepare it for file read/write access.
ITLibMediaItem * mediaItem =
NSURL * mediaItemLocation = mediaItem.location;
if (mediaItemLocation &&
// mediaItemLocation can be now used to read/write
// the media file
For more information about using URLs that are outside the default sandbox from a sandboxed app, see
Security-Scoped Bookmarks and Persistent Resource Access.
In non-sandboxed applications, you can use the returned location URL to access the media item file directly.
See Also Obtaining Information About This Media Item title
The title of this media item.
The title that iTunes uses when it sorts media items by title.
Information about the artist associated with this media item.
The name of the composer associated with this media item.
The name that iTunes uses when sorting by composer.
Whether this media item's rating is computed (calculated from its album rating).
If this media item is a podcast, this property contains the podcast start time.
If this media item is a podcast, this property contains the podcast stop time.
If this media item is an audio track, this property contains information about the corresponding album.
The genre associated with this media item as specified in the metadata of the file or by the user in iTunes.
The iTunes-specific string representation of the kind of this media item; for example,
"MPEG audio file"
"Book" media Kind
This media item's media kind. See the ITLibMediaItemMediaKind enum for a list of possible media kind values.
The size in bytes of this media item.
Deprecated total Time
The length of this media item in milliseconds.
The track number of this media item within its album.
If this media item is a podcast, this property contains the category of the podcast.
If this media item is a podcast, this property contains the description of the podcast.
lyrics Content Rating
If this media item has associated lyrics, this property specifies the content rating for those lyrics. See the ITLibMediaItemLyricsContentRating enum for a list of possible lyric content ratings.
The date when this media item was added to iTunes.
The date and time this media item was last modified in iTunes.
The bitrate of this media item in kbps.
The sample rate of this media item in samples per second.
beats Per Minute
If this media item is an audio track, this property contains the Beats Per Minute (BPM) of the audio.
The number of times this media item has been played in iTunes.
last Played Date
The date and time this media item was last played in iTunes, or nil if this media item has not been played.
The artwork of this media item.
Any comments associated with this media item.
Whether this media item was purchased from the iTunes store.
Whether this media item is a video such as a TV show, video podcast, or movie.
Video information (such as width and height) about this media item, if it is a video media item.
The year when this media item was released.
The Mac OS file type of this media item (deprecated).
Deprecated skip Count
The number of times the user has skipped this media item in iTunes.
The most recent date and time when this media item was skipped in iTunes.
volume Normalization Energy
The volume normalization energy applied by iTunes to this media item in order to bring the average or peak amplitude to a target level.
Whether the user has disabled this media item in iTunes.
The grouping of this media item as specified in the metadata of the file or by the user in iTunes.