Search code examples
iphoneobjective-ciosmpmediaitemmpmediaitemcollection

MPMediaItemCollection Whole Library?


Does anyone know if it's possible to create an MPMediaItemCollection object containing every song in a users iPod library without the user having to select it using the MPMediaPicker stuff? Like, on application launch perhaps.

Thanks...


Solution

  • Try this one

        MPMediaQuery *everything = [[MPMediaQuery alloc] init];
    
        NSArray *songs = [everything items];
        MPMediaItemCollection *mediaCollection = [MPMediaItemCollection collectionWithItems:songs];
        [everything release];