【问题标题】:Assertion failure in Split View Controller拆分视图控制器中的断言失败
【发布时间】:2014-07-08 16:56:32
【问题描述】:

我正在为 iPad 做一个应用程序。我有一个UISplitViewController,如果我在 UITableView 控制器中为我的几个视图控制器之一使用选择推送(如果我为此设置目标 DetailSplitViewController),应用程序崩溃。这个错误必须给出:

05/20/2014 13:59:32.439 Units [1534:60 b] *** Assertion failure in - [UIStoryboardPushSegue perform] / SourceCache/UIKit_Sim/UIKit-2935.137/UIStoryboardBuiltInSegues.m: 24
05/20/2014 13:59:32.441 Units [1534:60 b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected a navigation controller, but got an instance of' UIViewController 'instead, while performing a split view controller push segue (identifier'') for index # 1 '
*** First throw call stack:
(
    0   CoreFoundation                      0x02b6c1e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x017788e5 objc_exception_throw + 44
    2   CoreFoundation                      0x02b6c048 +[NSException raise:format:arguments:] + 136
    3   Foundation                          0x0114b4de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
    4   UIKit                               0x007a0ac4 -[UIStoryboardPushSegue perform] + 854
    5   UIKit                               0x0078ff0c -[UIStoryboardSegueTemplate _perform:] + 174
    6   UIKit                               0x0078ff87 -[UIStoryboardSegueTemplate perform:] + 115
    7   UIKit                               0x00315965 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1453
    8   UIKit                               0x00315b14 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 279
    9   UIKit                               0x0031a10e __38-[UITableView touchesEnded:withEvent:]_block_invoke + 43
    10  UIKit                               0x002490aa ___afterCACommitHandler_block_invoke + 15
    11  UIKit                               0x00249055 _applyBlockToCFArrayCopiedToStack + 403
    12  UIKit                               0x00248e76 _afterCACommitHandler + 532
    13  CoreFoundation                      0x02b3436e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    14  CoreFoundation                      0x02b342bf __CFRunLoopDoObservers + 399
    15  CoreFoundation                      0x02b12254 __CFRunLoopRun + 1076
    16  CoreFoundation                      0x02b119d3 CFRunLoopRunSpecific + 467
    17  CoreFoundation                      0x02b117eb CFRunLoopRunInMode + 123
    18  GraphicsServices                    0x02dc95ee GSEventRunModal + 192
    19  GraphicsServices                    0x02dc942b GSEventRun + 104
    20  UIKit                               0x0022bf9b UIApplicationMain + 1225
    21  Jednotky                            0x0000dc2d main + 141
    22  libdyld.dylib                       0x0640e701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

【问题讨论】:

    标签: ios ipad storyboard uisplitviewcontroller assertion


    【解决方案1】:

    原因已经告诉你了

    'Expected a navigation controller, but got an instance of' UIViewController 'instead'
    

    似乎您尝试推送 UIViewController,但您需要推送包装在 UINavigationController

    中的 UIViewController

    【讨论】:

    • 谢谢,但我是初学者,能告诉我怎么做吗?
    猜你喜欢
    • 1970-01-01
    • 2012-09-22
    • 1970-01-01
    • 1970-01-01
    • 2012-03-26
    • 1970-01-01
    • 1970-01-01
    • 2011-02-04
    相关资源
    最近更新 更多