我在网站上搜索了这个问题,但我无法解决问题。所以我想问我怎么解决这个问题?
我有一个导航控制器和一个视图控制器。我在导航控制器上添加了一些元素,它正在工作但是当我添加ViewController
并将其与导航控制器连接时,我发现了一个问题。我用segue连接它们,我想从导航控制器的元素传递到视图控制器。构建失败,我接受此错误代码;
2016-07-11 14:35:38.243 seg[4175:594378] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010cd73d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c7e7deb objc_exception_throw + 48
2 UIKit 0x000000010d8f7ca9 __copy_helper_block_ + 0
3 UIKit 0x000000010d871630 -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 460
4 UIKit 0x000000010d871433 -[UIStoryboardSegueTemplate _perform:] + 82
5 UIKit 0x000000010d8716f7 -[UIStoryboardSegueTemplate perform:] + 156
6 UIKit 0x000000010d271156 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1775
7 UIKit 0x000000010d27141b -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 388
8 UIKit 0x000000010d135f62 _runAfterCACommitDeferredBlocks + 317
9 UIKit 0x000000010d149e4c _cleanUpAfterCAFlushAndRunDeferredBlocks + 95
10 UIKit 0x000000010d156147 _afterCACommitHandler + 90
11 CoreFoundation 0x000000010cc98c37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
12 CoreFoundation 0x000000010cc98ba7 __CFRunLoopDoObservers + 391
13 CoreFoundation 0x000000010cc8e7fb __CFRunLoopRun + 1147
14 CoreFoundation 0x000000010cc8e0f8 CFRunLoopRunSpecific + 488
15 GraphicsServices 0x00000001105f3ad2 GSEventRunModal + 161
16 UIKit 0x000000010d129f09 UIApplicationMain + 171
17 seg 0x000000010c2e445f main + 111
18 libdyld.dylib 0x000000010f54d92d start + 1
19 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)