i wants multiple artists tracks ipod library . following code allow me specific artist tracks -
mpmediaquery *query = [[mpmediaquery alloc] init]; [query addfilterpredicate: [mpmediapropertypredicate predicatewithvalue:@"lady gaga" forproperty: mpmediaitempropertyartist]]; [query setgroupingtype: mpmediagroupingalbum]; nsarray *albums = [query collections];
is possible multiple artists tracks lady gaga & akon tracks single query predicatewithvalue sepearted ; or /
example-
[query addfilterpredicate: [mpmediapropertypredicate predicatewithvalue:@"lady gaga/ akon" forproperty: mpmediaitempropertyartist]];
please me how meet requirement .
you use aggregate operator in
(e.g. @"attribute in %@", acollection
)and filter whole collections
array nspredicate
:
nsarray *artists = @["lady gaga", @"justin bieber", @"selena gomez"]; mpmediaquery *query = [[mpmediaquery alloc] init]; [query setgroupingtype: mpmediagroupingalbum]; nspredicate *predicate = [nspredicate predicatewithformat:@"%@ in %@", mpmediaitempropertyartist, artists]; nsarray *albums = [[query collections] filteredarrayusingpredicate:predicate];
Comments
Post a Comment