So this is what i have so far:
-(void)mediaPicker: (MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection {
[self dismissModalViewControllerAnimated:YES];
// Assign the selected item(s) to the music player and start playback.
self.selectedSong = mediaItemCollection;
MPMediaItem *chosenItem = mediaItemCollection.representativeItem;
NSLog(@"chosenItem: %@", chosenItem);
persistentID = [chosenItem valueForProperty:MPMediaItemPropertyPersistentID]; //persistentID is an NSString.
NSLog(@"persistentID: %@", persistentID);
[prefs setValue:persistentID forKey:@"persistentIDKey"];
[prefs synchronize];
}
But now i need to figure out what to put in the part of the script where i want it retrieved. This would be the standard way of doing that..
[self.musicPlayer stop];
[self.musicPlayer setNowPlayingItem:*ITEM HERE*];
[self.musicPlayer play];
But i'm unsure what to put in there. Persistent ID doesn't work. I can also get any other properties from the song using my above method, not just persistentID. So if i require any others, then i can get those too. Help with this?
You should be able to do something like this: