iphone - How to retrieve the list of songs of Songs Library in array? -



iphone - How to retrieve the list of songs of Songs Library in array? -

following code retrieves songs nowadays in iphone want retrieve songs in array. mean can have array of names of songs in array? if yes, how can done?

thanks-

mpmediapickercontroller *picker = [[mpmediapickercontroller alloc] initwithmediatypes: mpmediatypemusic]; picker.delegate = self; picker.allowspickingmultipleitems = yes; picker.prompt = nslocalizedstring (@"add songs play", "prompt in media item picker"); [[uiapplication sharedapplication] setstatusbarstyle: uistatusbarstyledefault animated: yes]; [self presentmodalviewcontroller: picker animated: yes]; [picker release];

see ipod library access programming guide. in there's illustration shows media query matches entire library lets set in array:

mpmediaquery *everything = [[mpmediaquery alloc] init]; nslog(@"logging items generic query..."); nsarray *itemsfromgenericquery = [everything items]; (mpmediaitem *song in itemsfromgenericquery) { nsstring *songtitle = [song valueforproperty: mpmediaitempropertytitle]; nslog(@"%@", songtitle); }

iphone

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -