使用的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)