After clicking save button, the program will crash and stop at
public func createQuestionGroupViewController(
viewController: CreateQuestionGroupViewController,
created questionGroup: QuestionGroup) {
questionGroupCaretaker.questionGroups.append(questionGroup)
try? questionGroupCaretaker.save()
dismiss(animated: true , completion: nil)
tableView.reloadData() ← Program stops here when crash
}
The final project in the version 2.0 won’t crash.
I guess maybe it’s because the observer pattern’s problem? That is the only difference in SelectQuestionGroupViewController.
Can anybody help me to find out why it crashes?