【问题标题】:How to count songs from ipod Library including Duplicates如何计算 ipod 库中的歌曲,包括重复歌曲
【发布时间】:2009-12-19 03:30:00
【问题描述】:

我正在尝试计算 ipod 库中的歌曲总数。由于将任何具有相同标题的歌曲分组,因此不会添加到数组中。

MPMediaQuery *songsQuery = [[MPMediaQuery alloc] init];    
NSArray *mySongs = [songsQuery collections];     
NSLog(@"%d", [mySongs count]);

有替代/更好的方法吗?欢迎任何想法。

【问题讨论】:

    标签: objective-c ipod


    【解决方案1】:

    是的,请改用 [songsQuery items]。这将返回一个包含查询包含的所有 MPMediaItems 的 NSArray。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多