推送Segue错误,即使在“Push Segue”时也是如此。不使用(我使用模态segue) [英] Push Segue Error even when "Push Segue" is not used (I used modal segue)
问题描述
我收到了这个错误:'推送segues只能在源控制器由UINavigationController实例管理时使用。'
I got this error: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
我之前遇到过这个错误我非常熟悉它。它通常与导航控制器的使用有关。但是,在我的故事板中,我使用了模态segue
而我没有使用导航控制器。我不知道为什么会出现这个错误...
I've encountered this error before and I am very familiar with it. It's usually associated with the use of a navigation controller. However, in my storyboard, I used a modal segue
and I did not use a navigation controller. I have no clue why this error is there...
我还将ViewController类更新为MasterViewController作为初始视图控制器,但Xcode从未更新过这些信息...我我想知道如何让它更新。在编译之前我已经做了 Clean Build
。
I also updated the class ViewController to MasterViewController as the Initial View Controller but Xcode never updated this information...I'm wondering how I can get it to update. I already did a "Clean Build
" before compiling.
2014-02-21 20:18:27.039 GeoLocations[9599:70b] Unknown class ViewController in Interface Builder file.
2014-02-21 20:18:29.225 GeoLocations[9599:70b] *** 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 0x030035e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0247d8b6 objc_exception_throw + 44
2 UIKit 0x0172fca5 -[UIStoryboardPushSegue destinationContainmentContext] + 0
3 UIKit 0x0172007e -[UIStoryboardSegueTemplate _perform:] + 174
4 UIKit 0x017200f9 -[UIStoryboardSegueTemplate perform:] + 115
5 libobjc.A.dylib 0x0248f874 -[NSObject performSelector:withObject:withObject:] + 77
6 UIKit 0x011ed0c2 -[UIApplication sendAction:to:from:forEvent:] + 108
7 UIKit 0x011ed04e -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
8 UIKit 0x012e50c1 -[UIControl sendAction:to:forEvent:] + 66
9 UIKit 0x012e5484 -[UIControl _sendActionsForEvents:withEvent:] + 577
10 UIKit 0x012e4733 -[UIControl touchesEnded:withEvent:] + 641
11 UIKit 0x0122a51d -[UIWindow _sendTouchesForEvent:] + 852
12 UIKit 0x0122b184 -[UIWindow sendEvent:] + 1232
13 UIKit 0x011fee86 -[UIApplication sendEvent:] + 242
14 UIKit 0x011e918f _UIApplicationHandleEventQueue + 11421
15 CoreFoundation 0x02f8c83f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
16 CoreFoundation 0x02f8c1cb __CFRunLoopDoSources0 + 235
17 CoreFoundation 0x02fa929e __CFRunLoopRun + 910
18 CoreFoundation 0x02fa8ac3 CFRunLoopRunSpecific + 467
19 CoreFoundation 0x02fa88db CFRunLoopRunInMode + 123
20 GraphicsServices 0x0359e9e2 GSEventRunModal + 192
21 GraphicsServices 0x0359e809 GSEventRun + 104
22 UIKit 0x011ebd3b UIApplicationMain + 1225
23 GeoLocations 0x0000237d main + 141
24 libdyld.dylib 0x03f6770d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
推荐答案
你有没有附上导航控制器到你的第一个视图控制器,如果不是你应该有。因为应该嵌入导航控制器,推动另一个segue。
have you attached the Navigation Controller to your first view controller, If not you should have that. As navigation contrller should be embeded, to push another segue.
这篇关于推送Segue错误,即使在“Push Segue”时也是如此。不使用(我使用模态segue)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!