Когда я запускаю свое приложение каждый раз, когда я промахиваюсь влево, чтобы удалить мое приложение, и он указывает мне на поток 1: сигнал SIGABRT
«Я считаю, что это часть моего код, который вызывает егоПриложение падает, когда я прокручиваю влево, чтобы удалить ячейку
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == .Delete {
allItems[indexPath.section].removeAtIndex(indexPath.row)
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
} else if editingStyle == .Insert {
let newData = DataItem(title: "New Data", subtitle: "", imageName: nil)
allItems[indexPath.section].append(newData)
tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
}
}
override func setEditing(editing: Bool, animated: Bool) {
super.setEditing(editing, animated: animated)
if editing {
tableView.beginUpdates()
for (index, sectionItems) in allItems.enumerate() {
let indexPath = NSIndexPath(forRow: sectionItems.count, inSection: index)
tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
}
//tableView.beginUpdates()
tableView.setEditing(true, animated: true)
tableView.endUpdates()
} else {
tableView.beginUpdates()
}
вы обновить свой исходный массив Tableview –
Пожалуйста, пост полное сообщение об ошибке и трассировку стека из консоли –
?. В режиме отладки, который является строкой с ошибкой? – garanda