Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试让我的应用程序使用 MPMusicPlayerController 从 ipod 播放音乐,但有些设备在 ipod 库中没有音乐。谁能告诉我在初始化 ipod 播放器之前是否有办法检查 ipod 库中是否有音乐。
提前致谢。
if ([[[MPMediaQuery songsQuery] items] count] > 0) { // The user has songs in his or her library. }
MPMediaQuery *query = [MPMediaQuery 歌曲查询]; NSArray *collections = [查询集合];