我正在尝试打印我个人图书馆中的流派列表。我遇到了一个巨大的问题,我无法获得这些流派的实际名称。
我的代码是:
// Initialization:
let query = MPMediaQuery()
let result = query.items
print("count: \(result?.count)") //This returns the amount of items in my library
现在这里是问题所在:
query.groupingType = MPMediaGrouping.genre
var genreArray = query.collections
print(genreArray)
当我去打印它时,它给了我一个MPConcreteMediaItemCollection
带有十六进制的项目列表:
<MPConcreteMediaItemCollection: 0x1c00cbf30>, <MPConcreteMediaItemCollection: 0x1c00cbfa0>, <MPConcreteMediaItemCollection: 0x1c00cc010>, <MPConcreteMediaItemCollection: 0x1c00cc080>, <MPConcreteMediaItemCollection: 0x1c00cc0f0>, <MPConcreteMediaItemCollection: 0x1c00cc160>, <MPConcreteMediaItemCollection: 0x1c00cc1d0>, <MPConcreteMediaItemCollection: 0x1c00cc240>, <MPConcreteMediaItemCollection: 0x1c00cc2b0>, <MPConcreteMediaItemCollection: 0x1c00cc320>, <MPConcreteMediaItemCollection: 0x1c00cc390>, <MPConcreteMediaItemCollection: 0x1c00cc400>, <MPConcreteMediaItemCollection: 0x1c00cc470>, <MPConcreteMediaItemCollection: 0x1c00cc4e0>, <MPConcreteMediaItemCollection: 0x1c00cc550>, <MPConcreteMediaItemCollection: 0x1c00cc5c0>, <MPConcreteMediaItemCollection: 0x1c00cc630>, <MPConcreteMediaItemCollection: 0x1c00cc6a0>, <MPConcreteMediaItemCollection: 0x1c00cc710>, <MPConcreteMediaItemCollection: 0x1c00cc780>, <MPConcreteMediaItemCollection: 0x1c00cc7f0>, <MPConcreteMediaItemCollection: 0x1c00cc860>, <MPConcreteMediaItemCollection: 0x1c00cc8d0>, <MPConcreteMediaItemCollection: 0x1c00cc940>, <MPConcreteMediaItemCollection: 0x1c00cc9b0>, <MPConcreteMediaItemCollection: 0x1c00cca20>, <MPConcreteMediaItemCollection: 0x1c00cca90>, <MPConcreteMediaItemCollection: 0x1c00ccb00>, <MPConcreteMediaItemCollection: 0x1c00ccb70>, <MPConcreteMediaItemCollection: 0x1c00ccbe0>, <MPConcreteMediaItemCollection: 0x1c00ccc50>, <MPConcreteMediaItemCollection: 0x1c00cccc0>, <MPConcreteMediaItemCollection: 0x1c00ccd30>, <MPConcreteMediaItemCollection: 0x1c00ccda0>, <MPConcreteMediaItemCollection: 0x1c00cce10>, <MPConcreteMediaItemCollection: 0x1c00cce80>, <MPConcreteMediaItemCollection: 0x1c00ccef0>, <MPConcreteMediaItemCollection: 0x1c00ccf60>, <MPConcreteMediaItemCollection: 0x1c00ccfd0>, <MPConcreteMediaItemCollection: 0x1c00cd040>, <MPConcreteMediaItemCollection: 0x1c00cd0b0>])
我如何让这些值等同于实际的流派名称?