的電池我寫了下面的代碼顯示與SWIFT 2表視圖列表, 我需要相同的代碼,但是Xcode中給了錯誤,此代碼添加的tableview文本
我定義:
var toDoList = [string]()
,並在的tableview FUNC:
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{
let cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: "cell")
cell.textLabel?.text = toDoList[indexpath.row]
return cell
}
Xcode中具有低於誤差TodoList的[indexpath.row]:
鍵入'UITableView!'沒有下標成員
需要在swift 3中更改哪些內容?
您需要重新設置單元格。 –
從這裏接受幫助回答http://stackoverflow.com/questions/25826383/when-to-use-dequeuereusablecellwithidentifier-vs-dequeuereusablecellwithidentifi –
@agent_stack我該怎麼做? –