加载了笔尖但未设置视图插座

加载了笔尖但未设置视图插座

本文介绍了Xcode" - [UIViewController _loadViewFromNibNamed:bundle:]加载了笔尖但未设置视图插座。“错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xcode 4,当我运行我的应用时,第一个屏幕无法加载。它在模拟器和设备上失败了。我已经搜索了答案,他们都说要确保我已经将文件所有者中的圈子拖到正确的视图中。对不起,我不记得事情的名字,我是Xcode的新手。我把圆圈拖到正确的视图并尝试了很多东西,但没有一个能够工作。我可能做错了什么?

I'm using Xcode 4 and when I run my app, the first screen doesn't load. It fails in the simulators and on a device. I've searched for answers and they all say to make sure I've dragged the circles in Files Owner to the correct views. Sorry I don't remember the names of the things, I'm new to Xcode. I've dragged the circles to the correct view and tried many things but none of them worked. What could I be doing wrong?

以下是完整的错误:

2012-02-19 12:59:54.655 Ponyboard[271:207]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "PonyboardViewController" nib but the view outlet was not set.'

*** Call stack at first throw:
(
    0   CoreFoundation                      0x00f095a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x0105d313 objc_exception_throw + 44
    2   CoreFoundation                      0x00ec1ef8 +[NSException raise:format:arguments:] + 136
    3   CoreFoundation                      0x00ec1e6a +[NSException raise:format:] + 58
    4   UIKit                               0x0020d709 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
    5   UIKit                               0x0020b134 -[UIViewController loadView] + 120
    6   UIKit                               0x0020b00e -[UIViewController view] + 56
    7   UIKit                               0x0017ed42 -[UIWindow addRootViewControllerViewIfPossible] + 51
    8   Ponyboard                           0x00002a87 -[PonyboardAppDelegate application:didFinishLaunchingWithOptions:] + 135
    9   UIKit                               0x0015bc89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
    10  UIKit                               0x0015dd88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
    11  UIKit                               0x00168617 -[UIApplication handleEvent:withNewEvent:] + 1533
    12  UIKit                               0x00160abf -[UIApplication sendEvent:] + 71
    13  UIKit                               0x00165f2e _UIApplicationHandleEvent + 7576
    14  GraphicsServices                    0x031fd992 PurpleEventCallback + 1550
    15  CoreFoundation                      0x00eea944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    16  CoreFoundation                      0x00e4acf7 __CFRunLoopDoSource1 + 215
    17  CoreFoundation                      0x00e47f83 __CFRunLoopRun + 979
    18  CoreFoundation                      0x00e47840 CFRunLoopRunSpecific + 208
    19  CoreFoundation                      0x00e47761 CFRunLoopRunInMode + 97
    20  UIKit                               0x0015d7d2 -[UIApplication _run] + 623
    21  UIKit                               0x00169c93 UIApplicationMain + 1160
    22  Ponyboard                           0x000029c9 main + 121
    23  Ponyboard                           0x00002945 start + 53
)
terminate called after throwing an instance of 'NSException'


推荐答案

您确定已经分配了UIView(或子类)到PonyboardViewController的view属性?右键单击xib左侧窗格中的文件所有者以获取PonyboardViewController,并验证是否设置了视图插座。

Are you sure you have a UIView (or subclass) assigned to the "view" property of PonyboardViewController? Right click on "File Owner" in the left pane of the xib for PonyboardViewController and verify that the "view" outlet is set.

如果没有,请将其设置为视图!

If not, set it to a view!

这篇关于Xcode" - [UIViewController _loadViewFromNibNamed:bundle:]加载了笔尖但未设置视图插座。“错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 01:09