ios - 如何在滑动时使用 UITableView 执行 Segue?
问题描述
我正在尝试在我的 viewController 和 EditBrainDump 之间进行导航。唯一的问题是:如何使用 UITableView 执行 segue?
错误:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7f940c526660> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key inputName.'
动作代码:
let edit = UITableViewRowAction(style: .normal, title: "Edit") { (action, indexPath) in
// share item at indexPath
let itemId = self.brainList[indexPath.row].id
self.performSegue(withIdentifier: "editbraind", sender: self)
print(itemId)
}
edit.backgroundColor = UIColor.blue
return [delete, edit]
}
解决方案
推荐阅读
- python - 如何在 Python 的 unittest 框架中模拟返回 self 的方法
- c++ - 为什么只有当我在 C++ 中使用头文件 fstream 时才会出现错误“权限被拒绝”、“id 返回 1 退出状态”
- excel - 从一张纸的列中提取唯一值并将它们放在另一张纸中
- here-api - InfoBubble 地图中的自定义 CSS/样式
- pipeline - 计算机组织 - “预测采用”(总是采用)分支预测如何工作?
- c - 在 c 中使用数组打印模式
- python - 我可以在启动 Tk 小部件和窗口之前启动 Tk 变量吗?
- sql-update - 更新子查询成功但不更新
- kotlin - 为什么 Kotlin 在 JVM 中盲目地将内部类改为 public?
- c# - 操作留言卡未呈现