Xcode 4.5: Getting error “loaded the nib but the view outlet was not set”

﹥>﹥吖頭↗ 提交于 2019-12-06 13:55:31

问题


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" 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];


回答1:


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.



来源:https://stackoverflow.com/questions/11528254/xcode-4-5-getting-error-loaded-the-nib-but-the-view-outlet-was-not-set

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!