1

我有这两种方法可以为我获取 iPod 库的内容。我仍然不熟练使用这些类。例如,现在我将获取库中所有播客的播客标题,但是如果我想设置谓词和查询以获取作者/播客标题的各个播客,我该怎么做。

/* Delegate
 * Set which media type to get */
- (MPMediaPropertyPredicate *)mediaTypeToFetchFromiPodLibrary: (AbstractTVC *) sender;
{
     MPMediaPropertyPredicate *abPredicate =
     [MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithInt:MPMediaTypePodcast]
     forProperty:MPMediaItemPropertyMediaType];
    return abPredicate;
}


/* Overriden abstract method from subclass
 * */
- (MPMediaQuery *)setMediaQueryOptions: (MPMediaQuery*)abQuery
                         withPredicate: (MPMediaPropertyPredicate*) abPredicate
{
    [abQuery addFilterPredicate:abPredicate];
    //[abQuery setGroupingType:MPMediaGroupingAlbum];
    [abQuery setGroupingType:MPMediaGroupingPodcastTitle];
    return abQuery;
}
4

0 回答 0