Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIWindow not visible on top of Storyboard

I have a UIWindow object that I have want to show on top a Storyboard. That I made like this -

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

I am making it keyAndVisible like this -

[webWindow makeKeyAndVisible]; 

The problem is that it's not visible. I tried NSLog to see all the 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 window is used by Storyboard here - http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40006786-CH3-SW30

But its not clear how to use it to show a window on top of Storyboard.

like image 221
arank Avatar asked Dec 15 '11 23:12

arank


1 Answers

Rather than making a new UIWindow object and adding a subview to had to make object of the app delegate like -ExampleAppDelegate *myApp = (ExampleAppDelegate *)[UIApplication sharedApplication].delegate; And add subView like this - [myApp.window addSubview:aWebView];

like image 70
arank Avatar answered Oct 19 '22 15:10

arank