在加载mytableviewcontroller界面的时候报错:loaded the "" nib but didn't get a UITableView
原因:
If you have a NIB for the UITableViewController subclass
then its view outlet must be
hooked up to a UITableView.
代码:@interface mytableviewcontroller : UITableViewController
因为mytableviewcontroller是UITableViewController的子类,
所以在xib文件中,view必须是一个直接的TableView,而不应该是view下面加载的TableView
@interface mytableviewcontroller : UITableViewController应该是:

而不应该是

解决mytableviewcontroller界面加载时报错的问题,确保NIB文件中的视图出口正确连接到UITableView。
9488

被折叠的 条评论
为什么被折叠?



