Итак, я получаю это:
2019-07-10 13:33:49.054504-0700 akin[60767:2710637] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to delete row 2 from section 0 which only contains 1 rows before the update'
Когда я ищу в своем проекте deleteRows
, ничего не появляется.
Вот трассировка стека:
![enter image description here](https://i.stack.imgur.com/rL4hb.png)
Вот мой код для трассировки стека
@objc func handlePillTap(sender: UITapGestureRecognizer) {
let oldContext = movingPillRight.isActive ? "romance" : "social"
let sideTouched: Side = sender.location(in: movingPill).x > movingPill.frame.width / 2 ? .right : .left
updateModelContext(with: sideTouched)
styleView(importance: questionCellDelegate?.importance())
movePill(sideTouched)
let newContext = movingPillRight.isActive ? "romance" : "social"
if oldContext != newContext {
pillDelegate?.changeContext(Context(rawValue: newContext)!)
}
guard let delegate = questionCellDelegate else {return}
updateViewOfCell(from: delegate.question,
currentContext: currentQuestionContext,
delegate: pillDelegate as? UIViewController)
}
func changeContext(_ context: Context) {
currentQuestionContext = context
topBar.context = currentQuestionContext
responseTV.safelyReload(
questionsWrapper.question.responses.indexPaths, with: .fade )
}
func safelyReload(_ rows: [IndexPath], with animation: RowAnimation) {
DispatchQueue.main.async {
self.reloadRows(at: rows, with: animation)
}
}
Понятия не имею, почему я получаю эту ошибку.