Add the MediaPlayer.Framework to your project


#import <MediaPlayer/MPMediaQuery.h>
#import <MediaPlayer/MPMediaPlaylist.h>

	//----- LIST ALL SONGS -----
	MPMediaQuery *everything = [[MPMediaQuery alloc] init];
	
	NSLog(@"Logging items from a generic query...");
	NSArray *itemsFromGenericQuery = [everything items];
	for (MPMediaItem *song in itemsFromGenericQuery)
	{
		NSString *songTitle = [song valueForProperty: MPMediaItemPropertyTitle];
		NSLog (@"%@", songTitle);
		NSLog (@"\t%@", [song valueForProperty: MPMediaItemPropertyPersistentID]);
	}