我是 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
}
屏幕:
`
<小时/>最佳答案
确保加载的nib文件的 View 是一个UITableView
对象
关于ios - Swift (XCode) - sigabrt 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34594913/