修改 XIB 文件后应用程序崩溃

发布于 2024-11-25 05:18:53 字数 3316 浏览 2 评论 0原文

在 RootViewController.xib 上添加新的搜索栏并将其与 FileOwner 连接后,应用程序将崩溃。它在崩溃时报告堆栈:

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

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'

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

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'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

宛菡 2024-12-02 05:18:53

好吧,我不知道您希望我们告诉您什么,然后您的错误已经告诉您了。

由于未捕获的异常而终止应用程序
'NSInternalInconsistencyException',原因:'-[UIViewController
_loadViewFromNibNamed:bundle:] 加载了“RootViewController”笔尖但是
未设置视图出口。
'

那是您忘记连接 RootViewController 的视图出口,因此它不知道要加载什么。 MainWindow 的 RootViewController 是第一个要加载的东西,如果它不知道应该显示哪个视图,则会出现上述错误。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文