Through iTunes, you can create playlist folders that are nested arbitrarily deep. When you copy those playlist folders to your iOS device, iTunes is able to detect that they're folders, and allows you to drill down to the point where you ultimately get songs. Any idea how they do that?? I've been trying to figure this out for days.
When I query for a specific persistentID of a known folder, the only things I can see about it that are different from a playlist that contains songs are:
But, that's it! I don't see any way to get at the sub-folders. Or, when interrogating a playlist or subfolder that's contained within a folder, I don't see any way to tie it to the parent.
Apple does it in iTunes, so there must be a way. Are they using some private API?
There are the following undocumented properties that can get you what you are looking for using MPMediaPlaylist
's valueForProperty
method: @"isFolder"
, and @"parentPersistentID"
.
Note, these are not documented and do not appear in any header files, so use of them might be considered use of a 'private API' according to Apple's application submission rules.
I've opened a bug report to Apple asking that those be made available in header files, and also asking to clarify whether they are considered to be part of a private API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With