我收到了这个错误:'推送segues只能在源控制器由UINavigationController实例管理时使用。'
之前我遇到过这个错误,我对它非常熟悉。它通常与导航控制器的使用有关。但是,在我的故事板中,我使用了modal segue
而我没有使用导航控制器。我不知道为什么会出现这个错误...
我还将ViewController类更新为MasterViewController作为初始视图控制器,但Xcode从未更新过这些信息......我想知道如何让它更新。我在编译之前已经做了“Clean Build
”。
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)
答案 0 :(得分:0)
您是否已将导航控制器连接到第一个视图控制器,如果不是,则应该具有该控制器。因为应该嵌入导航控制器,推动另一个segue。