Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Unknown class RootViewController in Interface Builder file" ios6

Tags:

iphone

ios6

I've read a number of similar posts but I cannot get an answer that works for me. I have this beginning in my AppDelegate:

//LOAD WINDOWS

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.window makeKeyAndVisible];

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
        self.initialViewController = [[InitialViewController alloc] initWithNibName:@"InitialViewController" bundle:nil];
        [self.window setRootViewController:self.initialViewController];
    } else {
        self.patternViewController = [[PatternViewController alloc] initWithNibName:@"PatternView_iPhone" bundle:nil];
        [self.window setRootViewController: self.patternViewController];

    }

    return YES;

This is working for the iPad version, but not for the iPhone. I get these messages in the console:

  1. Unknown class RootViewController in Interface Builder file.
  2. Application windows are expected to have a root view controller at the end of application launch

The PatternView_iPhone xib is of the PatternViewController class.

In the project summary, I have these settings:

enter image description here

and

enter image description here

like image 754
ICL1901 Avatar asked Nov 18 '25 10:11

ICL1901


1 Answers

The error says that there is object whose class name is RootviewController in the xib .Open the xib/storyboard as source (Right click and open as source code) and search RootviewController. Find where the tag comes and find the object and change it to valid object.

like image 122
Lithu T.V Avatar answered Nov 20 '25 01:11

Lithu T.V