0

I've got the following app, whose RootViewController is named TopicsViewController.

When I run it, there aren't any errors or breaks but the screen is black. No table, populated or empty, just a black screen. Not sure which of the following is happening:

  • Is there something wrong with my application didFinishLaunchingWithOptions method in relation to a parser initlizing in it?
  • Is it something to do with my nib file for the TopicsViewController?

I can show more code from my TopicsViewController class if needed.

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
///////////////////////////////////////////

***initializing code for parser which populates TopicsViewController (not shown to save space)*****

///////////////////////////////////////////
UIViewController *rootController =
[[TopicsViewController alloc]
 initWithNibName:@"TopicsViewController" bundle:nil];

navController = [[UINavigationController alloc]
                 initWithRootViewController:rootController];

self.window = [[UIWindow alloc]
               initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window addSubview:navController.view];
[self.window makeKeyAndVisible];
return YES; 
}
Morkrom
  • 578
  • 7
  • 26
  • If you put a breakpoint at the return of your didFinishLaunchingWithOptions method, do you actually get to the end, or is your other code taking a long time to execute? – lehn0058 Jan 23 '13 at 18:49
  • Also, it looks like your view outlet is not set on the Topics Detail View Controller. You many need to set this, as this usually represents the first view layer you have, and is where all other views are added. – lehn0058 Jan 23 '13 at 18:51
  • Lehn0058, Interesting, it does not break when I put a point anywhere inside my launching options method. – Morkrom Jan 23 '13 at 19:06
  • There's nothing wrong with what you posted (other than what edzio27 said in his answer). The problem must be in your TopicsViewController – rdelmar Jan 23 '13 at 19:12

1 Answers1

1

Instead of:

[self.window addSubview:navController.view];

Write:

self.window.rootViewController = self.navController;
edzio27
  • 4,126
  • 7
  • 33
  • 48