Search Results

Search found 5 results on 1 pages for 'mpmediaitemcollection'.

Page 1/1 | 1 

  • Best Practices for persisting iPod Playlist (MPMediaItemCollection) across sessions

    - by coneybeare
    When using in-app audio in the iPhone SDK, it is possible to allow users to select a list from their ipod library and create an in-app local playlist. If I want to persist this choice, it is easy to serialize the data and write to file, then recover. Just vanilla like this, however, leads me to think there is going to be something wrong. For example, what if the user syncs and removes sounds? I can loop across them all and query the iPod DB at setup time, but with lists that could be 50,000 long, this could take some time. How are other people doing this and what are some gotchas that I haven't though about?

    Read the article

  • Why is setting queue in a MPMusicPlayerController only adding first track in collection?

    - by prendio2
    I have an Album object containing a MPMediaItemCollection of the album's tracks. When I add this collecton to the queue with the following line of code, only the first track gets added. [iPodMusicPlayer setQueueWithItemCollection:album.mediaItems]; Oddly enough when I add with the following line of code, everything works as expected. [iPodMusicPlayer setQueueWithItemCollection:[MPMediaItemCollection collectionWithItems:[album.mediaItems items]]]; Why would the second line work but not the first?

    Read the article

  • trying to delete a song from a list UITableView sigbart error - addMusic Example

    - by Pavan
    hi im trying to implement a delete feature into the addmusic example this is the code ive added it doesnt work, i cant get my head around whats wrong. can someone please tell me whats wrong and what i need to do to make sure it works. - (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath { } - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { // If row is deleted, remove it from the list. if (editingStyle == UITableViewCellEditingStyleDelete) { MainViewController *mainViewController = (MainViewController *) self.delegate; NSUInteger index = [indexPath row]; MPMediaItem *itemToDelete = [mainViewController.userMediaItemCollection mediaItemAtIndex:index]; if ([itemToDelete isEqual:mainViewController.musicPlayer.nowPlayingItem]) { [mainViewController.musicPlayer skipToNextItem]; } MPMediaItemCollection *newCollection = [mainViewController.userMediaItemCollection collectionByDeletingMediaItemAtIndex:index]; mainViewController.userMediaItemCollection = newCollection; NSUInteger indices[] = {0, index}; NSIndexPath *deletePath = [NSIndexPath indexPathWithIndexes:indices length:2]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:deletePath] withRowAnimation:UITableViewRowAnimationFade]; I also get these warnings when i compile the program and run it: heres the image: http://www.freeimagehosting.net/uploads/6e42f166b9.png Any ideas and help appreciated.

    Read the article

  • "SecondViewController" may not respond to '-updatePlayerQueueWithMedia:' Messages without a matching

    - by Pavan
    I don't understand whats happening I get a warning that says "SecondViewController" may not respond to '-updatePlayerQueueWithMedia:' Messages without a matching signature will be assumed to return 'id' and accept '...' as arguments. this is my method - (void)mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection { [self dismissModalViewControllerAnimated: YES]; [self updatePlayerQueueWithMediaCollection: mediaItemCollection]; } And the actual method which ive written in the same page is - (void) updatePlayerQueueWithMediaCollection: (MPMediaItemCollection *) mediaItemCollection { //and shit happens here. } I don't understand whats happening can someone please help me get rid of this warning.

    Read the article

  • Get unique artist names from MPMediaQuery

    - by Akash Malhotra
    I am using MPMediaQuery to get all artists from library. Its returning unique names I guess but the problem is I have artists in my library like "Alice In Chains" and "Alice In Chains ". The second "Alice In Chains" has some white spaces at the end, so it returns both. I dont want that. Heres the code... MPMediaQuery *query=[MPMediaQuery artistsQuery]; NSArray *artists=[query collections]; artistNames=[[NSMutableArray alloc]init]; for(MPMediaItemCollection *collection in artists) { MPMediaItem *item=[collection representativeItem]; [artistNames addObject:[item valueForProperty:MPMediaItemPropertyArtist]]; } uniqueNames=[[NSMutableArray alloc]init]; for(id object in artistNames) { if(![uniqueNames containsObject:object]) { [uniqueNames addObject:object]; } } Any ideas?

    Read the article

1