0

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.

cell.textLabel!.text = allSongs![indexPath.row]

is what i´m trying.

allSongs is declared like this var allSongs = [MPMediaItem]?()

Community
  • 1
  • 1
J.Vongehr
  • 323
  • 1
  • 4
  • 18

1 Answers1

0

You probably want to do something link this:

 cell.textLabel!.text = allSongs![indexPath.row].valueForProperty(MPMediaItemPropertyTitle) as? String
Alain T.
  • 40,517
  • 4
  • 31
  • 51