如何从 iPhone 音乐库中获取特定年份的所有歌曲?
嗨 Stack Overflowers,我希望你能帮助我。
我正在尝试获取特定年份(即 2002 年)用户 iPhone 音乐库中所有歌曲的集合。
然后我希望通过 MPMusicPlayerController 播放这些歌曲。
似乎您无法设置 MPMediaPropertyPredicate 来按发布日期进行过滤,我认为排除了这一点。我真正不想做的是必须获取所有曲目发布日期的完整数组,然后迭代所有 NSDate,因为我(可能是错误的)预计这对于大型库来说可能会相当慢。
完成这项任务的最佳方法是什么?
提前致谢。
Hi Stack Overflowers, I'm hoping you might be able to help me.
I'm trying to get a collection of all songs in a users iPhone music library from a specific year i.e 2002.
I'm then looking to play the songs through a MPMusicPlayerController.
It seems that you can't set up a MPMediaPropertyPredicate to filter by release date which I think rules that out. What I don't really want to do is have to get a full array of all track release dates and then iterate all the NSDates as I (perhaps wrongly) expect this could be quite slow for large libraries.
What is the best way of achieving this task?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是您正在寻找的东西。
here is what you are looking for.