2014-02-22 32 views
0

我得到这个错误:'只有在源控制器由UINavigationController实例管理时,才能使用Push segues。即使没有使用“Push Segue”,我们也推Push Segue Error(我使用模态segue)

我以前遇到过这个错误,我对它很熟悉。它通常与使用导航控制器相关。但是,在我的故事板中,我使用了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

您是否已将导航控制器附加到您的第一个视图控制器,如果没有,您应该有。由于导航控制器应嵌入,以推动另一个赛格。