ios - Swift (XCode) - sigabrt 错误

标签 ios swift sigabrt

我是 xcode 和 Swift 的新手。

当我完成我的应用程序时,我收到错误“SIGABRT”。我听说这很常见,但我在互联网上找到的所有解决方案都不起作用。我也听说我的代码是正确的,但 Storyboard有问题。

var NamesOfExercises = [
    ["name":"example1"],
    ["name":"example2"],
    ["name":"kexample3"]]

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return NamesOfExercises.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("mycell") as! ExercisesTableViewCell
    cell.nameLabel.text = NamesOfExercises[indexPath.item] ["name"]
    return cell
}

屏幕:

http://imgur.com/ZeA8fJQ

http://imgur.com/sDlTQCb

`

<小时/>

最佳答案

确保加载的nib文件的 View 是一个UITableView对象

关于ios - Swift (XCode) - sigabrt 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34594913/

相关文章:

ios - 将文本字段的值与 objective-c 中的数组内容匹配

ios - 当 SilentMode 开启时 AVAudioPlayer 不会静音

ios - CLLocationManager 忽略 stopUpdatingLocation

ios - 如何在其他viewController中使用变量? - swift

objective-c - OpenGLES 添加投影

ios - 滚动 tableview 会删除 uitableview 单元格中的复选标记

ios - 关闭按钮在 Swift Playground 中不起作用

ios - 在 MKMapView 上尝试多个注释时出现 SIGABRT 错误

runtime - "Sigabrt Error"-Codechef

objective-c - 在iOS私有(private)代码中调试iOS信号异常