7

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.

arank
  • 221
  • 3
  • 10
  • Got it! 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];` – arank Dec 16 '11 at 05:00
  • please post that comment as an answer and accept it. Other people can find it useful :) – Vivin Paliath Apr 03 '13 at 15:31

1 Answers1

1

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];

arank
  • 221
  • 3
  • 10
  • Ok, you solved **your** problem, but didn't answer your **question**. Sometimes it's needed to add another *UIWindow* not *UIView* – Oleg Trakhman Apr 06 '13 at 14:13