I know the question has been asked in the exact same way here cannot subscript a value of type [MPMediaItem] , but I don´t get his solution working.
我知道问题已经以完全相同的方式被问到这里不能下标类型[MPMediaItem]的值,但是我没有得到他的解决方案。
cell.textLabel!.text = allSongs![indexPath.row]
is what i´m trying.
是我正在尝试。
allSongs is declared like this var allSongs = [MPMediaItem]?()
allSongs声明如下var allSongs = [MPMediaItem]?()
1 个解决方案
#1
0
You probably want to do something link this:
您可能想要做一些链接:
cell.textLabel!.text = allSongs![indexPath.row].valueForProperty(MPMediaItemPropertyTitle) as? String
#1
0
You probably want to do something link this:
您可能想要做一些链接:
cell.textLabel!.text = allSongs![indexPath.row].valueForProperty(MPMediaItemPropertyTitle) as? String