UIWindow does not appear on top of the storyboard

I have a UIWindow object that I want to show on top of the storyboard. What I did like this:

UIWindow *webWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 20, 320,480)]; webWindow.windowLevel = UIWindowLevelAlert; 

I make it keyAndVisible as follows:

 [webWindow makeKeyAndVisible]; 

The problem is that it is not visible. I tried NSLog to see all Windows and it shows something like this -

 Windows:( "<UIWindow: 0x9b5cf20; frame = (0 0; 320 480); layer = <UIWindowLayer: 0x9b61400>>", "<UIWindow: 0x9846880; frame = (0 0; 320 480); layer = <UIWindowLayer: 0x9846a60>>" ) 

I read something about how the window is used in the Storyboard here - http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/ uid / TP40006786-CH3-SW30

But it's unclear how to use it to show a window on top of the storyboard.

+7
source share
1 answer

Instead of creating a new UIWindow object and adding a subtitle, you had to make an application delegate object, for example -ExampleAppDelegate * myApp = (ExampleAppDelegate *) [UIApplication sharedApplication] .delegate; And add a subView like this - [myApp.window addSubview: aWebView];

+1
source

All Articles