Show Playlist-folder in iOS App

99封情书 提交于 2020-01-01 07:11:21

问题


In iTunes I can create playlists and playlist-Folder. In this Folder i can create one or more playlists. Now I try to get all playlist and playlist-folder from iTunes in my iOS Application. I Use MPMediaQuery to get all playlists. I get my Playlist-folder as a own playlist. The items are all songs of all playlists in this folder.

I found not a property with which I can check whether my playlist is a folder.

Is it possible to get the playlist-folder from iTunes in my iOS Application?


回答1:


Both @"isFolder" and @"parentPersistentID" are able to return valid values in both iOS 9.3.5 and 10.1.1. You should use these with the valueForProperty: method like this:

[playlist valueForProperty:@"isFolder"];

As A.Matapolo stated in the comment on the OP, these are undocumented properties and may disappear or change at some point.

It looks like these have been available and undocumented for quite some time, at least since 2012: Detecting iTunes playlist folders on a device

I've submitted a bug report to Apple about this. I will update on Open Radar: https://openradar.appspot.com/radar?id=5037312413007872



来源:https://stackoverflow.com/questions/38568603/show-playlist-folder-in-ios-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!