我的目标是在iPod库中获取播放列表的封面图片。我已经做了类似以下的操作:
playlistMediaItemCollections = MPMediaQuery.playlistsQuery().collections ?? []
let artworks = playlistMediaItemCollections.map { $0.valueForKey(MPMediaItemPropertyArtwork) as? MPMediaItemArtwork }
但是它会导致错误
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MPConcreteMediaPlaylist 0x1468b1eb0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key artwork.'
有人知道如何获取播放列表的艺术封面吗?谢谢。