我收到此错误:
cell.naamItem = VragenInformatie[indexPath.section][indexPath.row][0]
我在同一个班级有这个:
var VragenInformatie: [[[String]]] = [[[]]]
这就是数组的样子:
var VragenInformatie: [[[String]]] = [[["Spelletjeskamer",""],["Keuken",""],["Garage",""],["Binnenplaats",""],["Zitkamer",""],["Slaapkamer",""],["Studeerkamer",""],["Eetkamer",""],["Badkamer",""]],[["De Wit",""],["Pimpel",""],["Blaauw van Draet",""],["Roodhart",""],["Groenewoud",""],["Van Geelen",""]],[["Loden pijp",""],["Pistool",""],["Engelse sleutel",""],["Dolk",""],["Touw",""],["Kandelaar",""]]]
我真的没有问题在这里我也不知道下标究竟意味着什么
有人可以提供一些建议吗?
答案 0 :(得分:1)
我打赌你的naamItem
是UILabel或类似的东西,你忘了附加' .text'。如果我的理论是正确的,那么你的代码应该是这样的:
cell.naamItem.text = VragenInformatie[indexPath.section][indexPath.row][0]
在naamItem
不是UILabel,UITextView或UITextField的任何其他情况下,您应确保naamItem
的类型为String
。