Xcode 4.5: Getting error “loaded the nib but the v

2019-04-15 11:45发布

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条回答
Lonely孤独者°
2楼-- · 2019-04-15 12:21

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.

查看更多
登录 后发表回答