Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>The question text seems like you are asking this...</strong> One way you can set it is like this:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. LoginViewController* loginView = [[[LoginViewController alloc]initWithNibName:nil bundle:nil]autorelease]; mainNavController = [[UINavigationController alloc]initWithRootViewController:loginView]; //here is the magic line [_window addSubview:mainNavController.view]; [self.window makeKeyAndVisible]; return YES; } </code></pre> <p>Or you can do it without the mainNavController:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. LoginViewController* loginView = [[[LoginViewController alloc]initWithNibName:nil bundle:nil]autorelease]; [_window addSubview:loginView.view]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; } </code></pre> <p><strong>The title seems like your asking this...</strong> Now the NSUnknownKeyException error usually crops up when you try to access a selector or a member of a class that does not exist or is spelled wrong (Usually the latter for me!). You can think of classes like a dictionary and calling a member, or function, is like asking for a dictionary object by it's key. Ex.</p> <pre><code>`@selector(misspelledFunctionName:)` </code></pre> <p>or</p> <pre><code>[object functionThatIsMisspelledOrNotDefinedInObject]; </code></pre> <p>I am unsure which question is being asked so I tried to answer both. Hopefully that will help :)</p> <p><strong>EDIT: These both ended up being the answer, or part of it anyways. The UIApplication did not have the correct view assigned to it so xib was sending keys that did not exist and caused it to crash. I removed the root view assignment from the plist (result no crashes but blank screen) then assigned the view like the above (the view displayed perfectly!).</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload