我有两种方法可以为我提取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;
}