我有以下内容:
MPMediaPropertyPredicate *titlePredicate = [MPMediaPropertyPredicate predicateWithValue:textString
forProperty:MPMediaItemPropertyTitle
comparisonType:MPMediaPredicateComparisonContains];
NSSet *predicateSet = [NSSet setWithObject:titlePredicate];
MPMediaQuery *searchQuery = [[MPMediaQuery alloc] initWithFilterPredicates:predicateSet];
NSArray *itemsFromTextQuery = [searchQuery items];
for (MPMediaItem *song in itemsFromTextQuery)
{
[arrayOfSongItems addObject:song];
}
效果很好,但只搜索了曲目的标题。我希望它返回标题、艺术家和专辑名称的结果。