切换到基于TabBar的应用程序

时间:2016-06-21 03:19:48

标签: objective-c xcode uitabbarcontroller xcode-storyboard

我在基于选项卡的应用程序中的标签之间移动时,我的应用程序中发现了常规崩溃。如果我清理我的项目,问题就不会消失。这个问题只发生在一个特定的ViewController上,它有一个带有几个项目的UIStackView(见下图)。有任何想法吗?这是崩溃的详细信息。可能问题是我来自这个VC的观点吗?

enter image description here

enter image description here

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/JS/Library/Developer/CoreSimulator/Devices/0EB640A8-A38D-451B-81DF-124F43ED521D/data/Containers/Bundle/Application/69891CB7-3978-41AA-8770-DD34202BBED6/Entelechy.app> (loaded)' with name 'D7U-k5-h22-view-pa4-wP-GXp' and directory 'Main.storyboardc''
*** First throw call stack:
(
    0   CoreFoundation                      0x01a8d494 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x01547e02 objc_exception_throw + 50
    2   CoreFoundation                      0x01a8d3bd +[NSException raise:format:] + 141
    3   UIKit                               0x0292caf0 -[UINib instantiateWithOwner:options:] + 554
    4   UIKit                               0x026b9380 -[UIViewController _loadViewFromNibNamed:bundle:] + 429
    5   UIKit                               0x026b9db8 -[UIViewController loadView] + 189
    6   UIKit                               0x026ba1c4 -[UIViewController loadViewIfRequired] + 154
    7   UIKit                               0x026baab1 -[UIViewController view] + 35
    8   UIKit                               0x0271bd33 -[UITabBarController _viewForViewController:] + 33
    9   UIKit                               0x02728491 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 606
    10  UIKit                               0x027273ae -[UITabBarController transitionFromViewController:toViewController:] + 76
    11  UIKit                               0x02722a7e -[UITabBarController _setSelectedViewController:] + 453
    12  UIKit                               0x02722885 -[UITabBarController setSelectedViewController:] + 252
    13  UIKit                               0x027271d9 -[UITabBarController _tabBarItemClicked:] + 587
    14  libobjc.A.dylib                     0x0155c0b5 -[NSObject performSelector:withObject:withObject:] + 84
    15  UIKit                               0x024ebe38 -[UIApplication sendAction:to:from:forEvent:] + 118
    16  UIKit                               0x024ebdb7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
    17  UIKit                               0x02946fd3 -[UITabBar _sendAction:withEvent:] + 525
    18  libobjc.A.dylib                     0x0155c0b5 -[NSObject performSelector:withObject:withObject:] + 84
    19  UIKit                               0x024ebe38 -[UIApplication sendAction:to:from:forEvent:] + 118
    20  UIKit                               0x024ebdb7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
    21  UIKit                               0x0268ff3b -[UIControl sendAction:to:forEvent:] + 79
    22  UIKit                               0x026902d4 -[UIControl _sendActionsForEvents:withEvent:] + 433
    23  UIKit                               0x0268ff7b -[UIControl sendActionsForControlEvents:] + 48
    24  UIKit                               0x0294cdc3 -[UITabBar(Static) _buttonUp:] + 123
    25  libobjc.A.dylib                     0x0155c0b5 -[NSObject performSelector:withObject:withObject:] + 84
    26  UIKit                               0x024ebe38 -[UIApplication sendAction:to:from:forEvent:] + 118
    27  UIKit                               0x024ebdb7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
    28  UIKit                               0x0268ff3b -[UIControl sendAction:to:forEvent:] + 79
    29  UIKit                               0x026902d4 -[UIControl _sendActionsForEvents:withEvent:] + 433
    30  UIKit                               0x0268f2c1 -[UIControl touchesEnded:withEvent:] + 714
    31  UIKit                               0x0256c52e -[UIWindow _sendTouchesForEvent:] + 1095
    32  UIKit                               0x0256d5cc -[UIWindow sendEvent:] + 1159
    33  UIKit                               0x0250ebe8 -[UIApplication sendEvent:] + 266
    34  UIKit                               0x024e3769 _UIApplicationHandleEventQueue + 7795
    35  CoreFoundation                      0x0199fe5f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    36  CoreFoundation                      0x01995aeb __CFRunLoopDoSources0 + 523
    37  CoreFoundation                      0x01994f08 __CFRunLoopRun + 1032
    38  CoreFoundation                      0x01994846 CFRunLoopRunSpecific + 470
    39  CoreFoundation                      0x0199465b CFRunLoopRunInMode + 123
    40  GraphicsServices                    0x05759664 GSEventRunModal + 192
    41  GraphicsServices                    0x057594a1 GSEventRun + 104
    42  UIKit                               0x024e9eb9 UIApplicationMain + 160
    43  Entelechy                           0x000b36da main + 138
    44  libdyld.dylib                       0x053b7a25 start + 1
    45  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

1 个答案:

答案 0 :(得分:1)

nib无法加载时会出现此类问题。 首先尝试Product--> Clean或 您可能添加了可能未正确引用的文件或您重命名的文件。 删除此类文件的引用并清理项目,提供正确的引用并重新运行。