Xcode 4.5:获取错误“加载了笔尖,但未设置视图出口". [英] Xcode 4.5: Getting error "loaded the nib but the view outlet was not set"

查看:75
本文介绍了Xcode 4.5:获取错误“加载了笔尖,但未设置视图出口".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新到Xcode 4.5 beta后,出现此错误.如果通过Xcode 4.3.3运行项目,则不会出现相同的错误.

After updating to Xcode 4.5 beta I have this error. I don't get the same error if I run the project by Xcode 4.3.3.

'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "LocationList" nib but the view outlet was not set.'

"LocationList"是一个自定义单元格,所有者是UITableViewController的子类.我试图将其子类化为UIViewController并将其连接到IB中的视图",但随后它无法识别[self.tableview reloadData];

"LocationList" is a custom cell and the owner is a subclass of UITableViewController. I tried to subclass it to UIViewController and connect it to "view" in IB but then it doesn't recognize [self.tableview reloadData];

推荐答案

我遇到了同样的问题,而我所做的只是覆盖loadView方法.因此,奇怪的新Xcode无法确定当我们重写UITableViewConroller时不应该从Nib加载TableView(在我的情况下,我没有使用IB来放置TableView,只是创建了一个新类,它是UITableViewController的子类,在Xcode 3.3中可以正常工作,但在4.5中则不能). 这肯定会解决您的问题,

I had the same issue and what I did was just overriding the loadView method. So weird new Xcode cannot figure that it is not supposed to load the TableView from the Nib when we override the UITableViewConroller (in my case I did not use IB to put a TableView, just created a new class which is a subclass of UITableViewController, this works fine in Xcode 3.3 but not in 4.5). This would definitely fix your issue,

-(void)loadView {
[super loadView];

}

但是我不确定原因是什么.

but I am not so sure about the cause for this.

这篇关于Xcode 4.5:获取错误“加载了笔尖,但未设置视图出口".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆