我在 Crashlytics 报告中遇到了这个奇怪的崩溃,我不确定发生了什么。我什至不知道行号“0”是什么意思。有任何想法吗?
didSelect 方法的代码:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
switch indexPath.section {
case 1:
let vc = WTShowDetailVC()
vc.show = bottomFeaturedShows[indexPath.row].show
navigationController?.pushViewController(vc, animated: true)
case 2:
let vc = WTShowDetailVC()
vc.show = lastWatchedShows[indexPath.row]
navigationController?.pushViewController(vc, animated: true)
case 3:
let vc = WTTapperProfileUserVC()
vc.tapper = popularTappers[indexPath.row]
navigationController?.pushViewController(vc, animated: true)
default:
println("Something went wrong")
}
}
最佳答案
这通常发生在您展开可选值且其值为 nil
时。尝试将 nil
检查到 navigationController
。
if let navigationcontroller: UINavigationController = navigationController {
navigationcontroller.pushViewController(vc, animated: true)
}
关于ios - EXC_BREAKPOINT UNKNOWN 在 "0"行崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30075775/