问题
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