Exception while trying using UITabBarController with UITableViewController
in iOS
I'm newbie. I'm trying to use UITabBarController with
UITableViewController (without UINavigationController), but I've faced
with exception after modifying std tabbar project
Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: '-[UITableViewController
loadView] loaded the "IHHideView" nib but didn't get a UITableView.'
My didFinishLaunching
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]
bounds]];
// Override point for customization after application launch.
UIViewController *hideViewController = [[IHHideViewController alloc]
init];
UIViewController *unhideViewController = [[IHUnhideViewController
alloc] init];
UIViewController *filesVIewController = [[IHFilesViewController alloc]
init];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers =
@[hideViewController,unhideViewController,filesVIewController];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
IHHideViewController just simplesubclass of UITableViewController
@interface IHHideViewController : UITableViewController
@end
As I know UITableViewController create own UITableView object with the
correct dimensions and autoresize mask if not to specify nib file. Why
such exception occurs?
No comments:
Post a Comment