加载的笔尖但“视图”插座未设置 [英] Loaded nib but the 'view' outlet was not set
问题描述
我在我的项目中添加了一个新的nib文件,并尝试加载它。
I added a new nib file to my project, and tried to load it.
然而,当我点击工具栏图标时,我应该带我去我创建的视图,我得到一个 NSInternalInconsistencyException
,并带有以下消息:
However, when I click on the toolbar icon that is supposed to take me to the view that I created, I get an NSInternalInconsistencyException
with the message:
终止应用程序由于未捕获的异常
'NSInternalInconsistencyException',原因:' - [UIViewController
_loadViewFromNibNamed:bundle:]加载了...nib但视图插座未设置。'
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "..." nib but the view outlet was not set.'
所以我打开了我的nib文件,我看到视图中没有设置引用插座。但是,我尝试点击并将新引用插座的圆圈拖到文件所有者,但它不会让我...我需要做什么才能显示我的视图?
So I opened up my nib file, and I see for the view that there are no referencing outlets set. However, I try to click and drag the circle for "new referencing outlet" to File's Owner, but it won't let me...what do I need to do to get my view to display?
推荐答案
未设置View Identity - Class Identity。将其设置为适当的类后,问题就解决了。
The View Identity - Class Identity was not set. After setting it to the appropriate class, the issue was resolved.
这篇关于加载的笔尖但“视图”插座未设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!