From 117be96d5c48587264cdf363b75ee906f905417d Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Mon, 3 Aug 2015 17:11:10 +0300 Subject: [PATCH] strong reference to the window added --- application/application.ios.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/application/application.ios.ts b/application/application.ios.ts index 59fcc208d..e45eb2a19 100644 --- a/application/application.ios.ts +++ b/application/application.ios.ts @@ -55,10 +55,12 @@ class NotificationReceiver extends NSObject { } class IOSApplication implements definition.iOSApplication { - private _delegate: typeof UIApplicationDelegate; public rootController: any; + + private _delegate: typeof UIApplicationDelegate; private _registeredObservers = {}; private _currentOrientation = UIDevice.currentDevice().orientation; + private _window: Window; constructor() { this.addNotificationObserver(UIApplicationDidFinishLaunchingNotification, this.didFinishLaunchingWithOptions); @@ -96,8 +98,8 @@ class IOSApplication implements definition.iOSApplication { } private didFinishLaunchingWithOptions(notification: NSNotification) { - let window = Window.alloc().initWithFrame(UIScreen.mainScreen().bounds); - window.backgroundColor = UIColor.whiteColor(); + this._window = Window.alloc().initWithFrame(UIScreen.mainScreen().bounds); + this._window.backgroundColor = UIColor.whiteColor(); if (exports.onLaunch) { exports.onLaunch(); @@ -121,11 +123,11 @@ class IOSApplication implements definition.iOSApplication { } } - window.content = topFrame; + this._window.content = topFrame; - this.rootController = window.rootViewController = topFrame.ios.controller; + this.rootController = this._window.rootViewController = topFrame.ios.controller; - window.makeKeyAndVisible(); + this._window.makeKeyAndVisible(); } private didBecomeActive(notification: NSNotification) {