我知道在cannot subscript a value of type [MPMediaItem]处以完全相同的方式提出了问题,但是我没有得到他的解决方案。
cell.textLabel!.text = allSongs![indexPath.row]
这就是我想要的。
allSongs像这样声明
var allSongs = [MPMediaItem]?()
最佳答案
您可能想做一些链接:
cell.textLabel!.text = allSongs![indexPath.row].valueForProperty(MPMediaItemPropertyTitle) as? String