【发布时间】:2017-04-20 11:41:08
【问题描述】:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
cell.viewcontroller = self
}
func reloadData(){
// reload function here, so when called it will reload the tableView
self.notificationTable.reloadData()
}
Tableview 单元格按钮代码
@IBAction func deleteRecord(_ sender: Any) {
self.viewController.reloadData() //<--
}
遇到错误
@
NotificationTableViewCell.swift:64:18: 类型值 'UIViewController' 没有成员 'reloadData'
【问题讨论】:
-
在这里
self.viewController.reloadData()使用你的tableview名称self. notificationTable.reloadData() -
为什么你在 tableViewCell 中声明了 deleteRecord() ?
-
你查过max的答案了吗?
标签: ios swift uitableview uiview