Ios 从子视图控制器(选项卡)传递到视图控制器

Ios 从子视图控制器(选项卡)传递到视图控制器,ios,objective-c,iphone,uiviewcontroller,Ios,Objective C,Iphone,Uiviewcontroller,我有一个选项卡ViewControllerA和5个子视图控制器B,我想从一个子视图控制器传递到故事板C中的另一个视图控制器 我在子视图控制器B中制作了一个按钮,并将其链接到我的C,在我的故事板中按下按钮,但当我单击它时,我得到的是: 2015-07-04 16:04:36.641 LoginSampleFB[1447:74036] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Push s

我有一个选项卡ViewControllerA和5个子视图控制器B,我想从一个子视图控制器传递到故事板C中的另一个视图控制器

我在子视图控制器B中制作了一个按钮,并将其链接到我的C,在我的故事板中按下按钮,但当我单击它时,我得到的是:

2015-07-04 16:04:36.641 LoginSampleFB[1447:74036] *** 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                      0x000000010d2c2c65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010cf5bbb7 objc_exception_throw + 45
    2   UIKit                               0x000000010bd37d72 -[UIStoryboardPushSegue destinationContainmentContext] + 0
    3   UIKit                               0x000000010b7ead62 -[UIApplication sendAction:to:from:forEvent:] + 75
    4   UIKit                               0x000000010b8fc50a -[UIControl _sendActionsForEvents:withEvent:] + 467
    5   UIKit                               0x000000010b8fb8d9 -[UIControl touchesEnded:withEvent:] + 522
    6   UIKit                               0x000000010b837958 -[UIWindow _sendTouchesForEvent:] + 735
    7   UIKit                               0x000000010b838282 -[UIWindow sendEvent:] + 682
    8   UIKit                               0x000000010b7fe541 -[UIApplication sendEvent:] + 246
    9   UIKit                               0x000000010b80bcdc _UIApplicationHandleEventFromQueueEvent + 18265
    10  UIKit                               0x000000010b7e659c _UIApplicationHandleEventQueue + 2066
    11  CoreFoundation                      0x000000010d1f6431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    12  CoreFoundation                      0x000000010d1ec2fd __CFRunLoopDoSources0 + 269
    13  CoreFoundation                      0x000000010d1eb934 __CFRunLoopRun + 868
    14  CoreFoundation                      0x000000010d1eb366 CFRunLoopRunSpecific + 470
    15  GraphicsServices                    0x000000010fab8a3e GSEventRunModal + 161
    16  UIKit                               0x000000010b7e98c0 UIApplicationMain + 1282
    17  LoginSampleFB                       0x000000010b4533ef main + 111
    18  libdyld.dylib                       0x000000010db5a145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
您应该添加UINavigationController作为选项卡,并使用ViewController B作为这些导航控制器的根。只有这样,你才能推。否则,您必须使用模态表示,它将部分或全部覆盖选项卡栏控制器