views:

82

answers:

1

I am trying to count the total songs from the ipod library. Due to grouping any songs with same title will not be added to the array.

MPMediaQuery *songsQuery = [[MPMediaQuery alloc] init];    
NSArray *mySongs = [songsQuery collections];     
NSLog(@"%d", [mySongs count]);

Is there an alternative/better way? Any ideas welcome.

+1  A: 

Yes, use [songsQuery items] instead. That returns an NSArray with all the MPMediaItems the query contains.

refulgentis