问题
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