ios - EXC_BREAKPOINT UNKNOWN 在 "0"行崩溃

标签 ios swift crash

我在 Crashlytics 报告中遇到了这个奇怪的崩溃,我不确定发生了什么。我什至不知道行号“0”是什么意思。有任何想法吗?

enter image description here

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/

相关文章:

c - 比较2个单链接列表中的元素并进行程序崩溃(通常)

android - 应用无法在具有更高API的测试设备上启动

swift - 如何使用 Swift 在 FireBase 数据库中发生更改时获取计数值?

ios - 获取 UIAlertController 操作表宽度

ios - 我将如何为我的 UITableView 设计一个异步图像下载器,它根据 TableView 中的位置确定下载的优先级?

ios - 在 Swift 中触摸 SKSpriteNode 时无法激活代码

ios - 用户位置及方向

silverlight - 是否还有其他人在Silverlight中遇到怪异的调试+崩溃行为?

ios - 为什么我在 iOS 9 上收到重复的推送通知?

ios - 从控制台 XCode iOS 应用程序(不是命令行应用程序)读取