You can call up the MPMediaPickerController using this:
- (IBAction) selectSong: (id) sender
{
MPMediaPickerController *picker =
[[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic];
picker.delegate = self;
picker.allowsPickingMultipleItems = NO;
picker.prompt = NSLocalizedString (@"Select any song from the list", @"Prompt to user to choose some songs to play");
[self presentModalViewController: picker animated: YES];
}
Then you can add the songs that were selected to your own array using something like this.
Note: You will access meta-data information from each track using valueForProperty.
- (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection
{
[self dismissModalViewControllerAnimated: YES];
someMutableArray = [mediaItemCollection mutableCopy];
}
Then this is kind of self explanatory but necessary:
- (void) mediaPickerDidCancel: (MPMediaPickerController *) mediaPicker
{
[self dismissModalViewControllerAnimated: YES];
}
For more information visit Apple's iPod Library Access Programming Guide