iOS: Don't check for existing window in QIOSMainWrapperApplicationDelegate

The delegate is only used when we control the application, so we know
that there isn't any window yet.

Change-Id: Ibd774cb4fd8ceaab6a181769d2792b569f490495
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
bb10
Tor Arne Vestbø 2012-12-25 21:44:13 +01:00
parent e30659aaf5
commit b05c20b4f3
1 changed files with 8 additions and 12 deletions

View File

@ -55,20 +55,16 @@ extern int qt_main(int argc, char *argv[]);
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// We may have a window already from a NIB or storyboard
if (!self.window) {
// If not, we create one ourselves
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
QIOSViewController *controller = [[QIOSViewController alloc] init];
self.window.rootViewController = controller;
controller.view = [[UIView alloc] init];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
QIOSViewController *controller = [[QIOSViewController alloc] init];
self.window.rootViewController = controller;
controller.view = [[UIView alloc] init];
// Aid debugging during development
self.window.backgroundColor = [UIColor cyanColor];
self.window.rootViewController.view.backgroundColor = [UIColor magentaColor];
// Aid debugging during development
self.window.backgroundColor = [UIColor cyanColor];
self.window.rootViewController.view.backgroundColor = [UIColor magentaColor];
[self.window makeKeyAndVisible];
}
[self.window makeKeyAndVisible];
// We schedule the main-redirection for the next eventloop pass so that we
// can return from this function and let UIApplicationMain finish its job.