【问题标题】:delegate = self causes Thread 1: exc_bad_instruction (code=exc_i386_invop subcode=0x0)delegate = self 导致线程 1:exc_bad_instruction (code=exc_i386_invop subcode=0x0)
【发布时间】:2017-07-18 15:33:07
【问题描述】:
@IBOutlet weak var tableView: UITableView!

override func viewDidLoad() {
    super.viewDidLoad()

    tableView.delegate = self // error occurs here
}

【问题讨论】:

  • 很可能您没有将表格视图连接到情节提要中的插座。
  • 请向我们展示更多代码。这并不能告诉我们您的类是否符合 TableViewDelegate 所需的协议。
  • @BennX 这是一个运行时错误,所以我们知道该类已经符合要求。如果没有,代码将无法编译。

标签: swift xcode uitableview self exc-bad-instruction


【解决方案1】:

确保您的@IBOutlet tableView 与界面生成器正确连接。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-13
    • 1970-01-01
    • 2015-10-19
    • 2016-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多