I am using the Apple Media Player Framework in my application. To fetch items I am using the MPMediaQuery
as described in their documents. Which works well, but when using the predefined query to retrieve all artists, I get duplicated entries for few artists.
Can somebody explain why there are duplicates? How do I suppress them?
NSArray *collections = [[MPMediaQuery artistsQuery] collections];
(And no there aren't any typos or differences in the casing in the name of the artist!)
NSSet *uniqueArtists = [NSSet setWithArray:collections];
. See if this removes the duplicates. Otherwise there must be something that makes the artists duplicate despite same artist name. – Gennie