开发者社区> 问答> 正文

关于推送segue时ios6崩溃

使用的CalculatorViewController中有一个graph按钮。点击按钮会触发segue推送到CalculaterGraphViewController 。运行之后崩溃了。

CalculatorViewController.m中的代码:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([segue.identifier isEqualToString:@"Show Graphs"])
    {
        // Do we need to set something else up in case it crashes 
    }   
}

崩溃信息输出:

2013-07-01 18:32:13.170 Calculator[1150:c07] * Terminating app due to uncaught exception 'NSGenericException', reason: 'Could not find a navigation controller for segue 'Show Graphs'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.' * First throw call stack: (0x1c95012 0x10d2e7e 0x46cf31 0x45eb99 0x45ec14 0x10e6705 0x1a2c0 0x1a258 0xdb021 0xdb57f 0xda6e8 0x49cef 0x49f02 0x27d4a 0x19698 0x1bf0df9 0x1bf0ad0 0x1c0abf5 0x1c0a962 0x1c3bbb6 0x1c3af44 0x1c3ae1b 0x1bef7e3 0x1bef668 0x16ffc 0x2abd 0x29e5 0x1) libc++abi.dylib: terminate called throwing an exception (lldb) 

展开
收起
爵霸 2016-03-19 09:44:45 2022 0
0 条回答
写回答
取消 提交回答
问答地址:
问答排行榜
最热
最新

相关电子书

更多
移动 App 性能监测实践(iOS篇) 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载