开发者

App crash after modification on the XIB files

开发者 https://www.devze.com 2023-03-21 07:27 出处:网络
After adding a new searchbar on the RootViewController.xib, and connecting it with the FileOwner, the App will crash. It reports the stack when crash:

After adding a new searchbar on the RootViewController.xib, and connecting it with the FileOwner, the App will crash. It reports the stack when crash:

2011-07-17 17:12:43.756 TableView[1397:207] *** Terminating app due to uncaught 
exception 'NSInternalInconsistencyException', reason: '-[UIViewController 
_loadViewFromNibNamed:bundle:] loaded the "RootViewController" nib but the view outlet 
 was not set.'
 *** Call stack at first throw:
 (
0   CoreFoundation                      0x00dc85a9 __exceptionPreprocess + 185

1   libobjc.A.dylib                     0x00f1c313 objc_exception_throw + 44开发者_StackOverflow中文版

2   CoreFoundation                      0x00d80ef8 +[NSException raise:format:arguments:] + 136

3   CoreFoundation                      0x00d80e6a +[NSException raise:format:] + 58

4   UIKit                               0x0036a709 -[UIViewController _loadViewFromNibNamed:bundle:] + 295

5   UIKit                               0x00368134 -[UIViewController loadView] + 120

6   UIKit                               0x004c1dd8 -[UITableViewController loadView] + 80

7   UIKit                               0x0036800e -[UIViewController view] + 56

8   UIKit                               0x003667f5 -[UIViewController nextResponder] + 34

9   UIKit                               0x003874a6 -[UIResponder _containsResponder:] + 41

10  UIKit                               0x00371c4e -[UINavigationController defaultFirstResponder] + 80

11  UIKit                               0x00386647 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 42

12  UIKit                               0x00386663 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 70

13  UIKit                               0x00386406 -[UIResponder(Internal) _promoteDeepestDefaultFirstResponder] + 42

14  TableView                           0x00002a0a -[TableViewAppDelegate application:didFinishLaunchingWithOptions:] + 135

15  UIKit                               0x002b8c89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163

16  UIKit                               0x002bad88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439

17  UIKit                               0x002c5617 -[UIApplication handleEvent:withNewEvent:] + 1533

18  UIKit                               0x002bdabf -[UIApplication sendEvent:] + 71

19  UIKit                               0x002c2f2e _UIApplicationHandleEvent + 7576

20  GraphicsServices                    0x01720992 PurpleEventCallback + 1550

21  CoreFoundation                      0x00da9944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52

22  CoreFoundation                      0x00d09cf7 __CFRunLoopDoSource1 + 215

23  CoreFoundation                      0x00d06f83 __CFRunLoopRun + 979

24  CoreFoundation                      0x00d06840 CFRunLoopRunSpecific + 208

25  CoreFoundation                      0x00d06761 CFRunLoopRunInMode + 97

26  UIKit                               0x002ba7d2 -[UIApplication _run] + 623

27  UIKit                               0x002c6c93 UIApplicationMain + 1160
28  TableView                           0x00002960 main + 102
29  TableView                           0x000028f1 start + 53
30  ???                                 0x00000001 0x0 + 1
 )

 terminate called after throwing an instance of 'NSException'


Well I don't know what you want us to tell you more then your error is already telling you.

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "RootViewController" nib but the view outlet was not set.'

That is that you forgot to connect your view outlet of your RootViewController so it does not know what to load. The RootViewController of your MainWindow is the first thing that's going to be loaded, if it does not know what view it should display it will give you the above error.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号