I'm creating a simple alarm and would like to know how to "pick" or "point" to a certain song chosen by the user, which is in your iPod app library.
How could I store this note?
I'm creating a simple alarm and would like to know how to "pick" or "point" to a certain song chosen by the user, which is in your iPod app library.
How could I store this note?
There is a library for functions with iPod . The item you are going to need is the MPMediaItem
that is the music itself and when using the valueForProperty:
method you get some properties that can be stored as the "note" you need and use it to get it back. I'm not sure if it's possible to store MPMediaItem
itself.
An example that is in the documentation itself:
MPMediaQuery *everything = [[MPMediaQuery alloc] init];
NSArray *itemsFromGenericQuery = [everything items];
for (MPMediaItem *song in itemsFromGenericQuery) {
NSString *songTitle = [song valueForProperty: MPMediaItemPropertyTitle];
NSLog (@"%@", songTitle);
}
And there's the possibility to include predicate to filter, or if you prefer, you have Media Picker , which functions as a selector.