iphoneios6

How to fix "Unknown class RootViewController in Interface Builder file" 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


Solution

  • 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.