Reputation: 4545
I am implementing a basic application that which allows to select a play list from music with in the application. I make it. But my problem is it is showing directly Music tab directly. But as per my requirements I need to show the playlist tab when the user takes to that view. Following is my code,
MPMediaPickerController *picker =
[[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic];
picker.delegate = self;
picker.allowsPickingMultipleItems = YES;
picker.prompt = NSLocalizedString (@"Select any song from the list", @"Prompt to user to choose some songs to play");
// The media item picker uses the default UI style, so it needs a default-style
// status bar to match it visually
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleDefault animated: YES];
[self presentModalViewController: picker animated: YES];
[picker release];
Upvotes: 0
Views: 834
Reputation: 768
-(IBAction)btnSelectSong:(id)sender
{
MPMediaPickerController *picker =
[[MPMediaPickerController alloc]
initWithMediaTypes: MPMediaTypeAnyAudio];
[picker setDelegate: self];
[picker setAllowsPickingMultipleItems: YES];
picker.prompt =
NSLocalizedString (@"Add songs to play",
"Prompt in media item picker");
[self presentModalViewController: picker animated: YES];
}
Upvotes: 2
Reputation: 451
opening in the playlist section of MPMediaPickerController is not possible according to Apple's documentation
as already i answered here: You will need to implement your own picker, using media queries (by song ,by artist, etc).
You will need to implement your own picker, using media queries (by song ,by artist, etc).
I suggest reading: “Using the iPod Library” in Apple's "iPod Library Access Programming Guide"
and more specific: MPMediaPlaylist Class Ref
Upvotes: 0