1

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?

2 Answers 2

1

It is because you are sub-classing a TableViewController. Instead change:

@interface IHHideViewController : UITableViewController

to:

@interface IHHideViewController : UIViewController
Sign up to request clarification or add additional context in comments.

1 Comment

Hm... without TabBarController subclassing UITableViewController works as I expect (without exception)...
0

Hmmm recreating project using empty template solve problem.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.