How to use only one music from iPod app library?

Asked

Viewed 63 times

0

I am creating a simple alarm and would like to know how to "pick up" or "point" to a particular song chosen by the user, which is in your iPod app library.

How could I store this note?

1 answer

0

There is a library for functions with the iPod. The item in question you will need is the MPMediaItem which is music itself and using the method valueForProperty: you can get some properties that can be stored like the "note" you need and use to fetch it again. I’m not sure it’s possible to store itself MPMediaItem.

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 that there is the possibility to include predicate to filter or if you prefer, have a Media Picker, which acts as any selector.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.