Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
359 views
in Technique[技术] by (71.8m points)

ios - Loaded the nib but didn't get a UITableView Exception

I'm trying to load a uitableview using ECSlidingViewController methods.

When I call this code:

UIStoryboard*  sb = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone"
                                              bundle:nil];
UITableViewController* page = [sb instantiateViewControllerWithIdentifier:@"tableViewPage"];

CGRect frame = self.slidingViewController.topViewController.view.frame;
self.slidingViewController.topViewController = page;
self.slidingViewController.topViewController.view.frame = frame;
[self.slidingViewController resetTopView];

while "tableViewPage" is a tableView Controller, not a view with a table. It gives me:

[UITableViewController loadView] loaded the "Bzc-w8-vsI-view-gnu-XH-Eb0" nib but didn't get a UITableView.'

I tried to made a method like topViewController just for uitableviewcontroller instead of uiviewcontroller ... but I failed. What did I miss?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I think it's trying to tell you that you have a UITableViewController in your storyboard but the top-level view associated with that controller is not a UITableView.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...