I have only one window and I tried
UIWindow* mWindow = [[UIApplication sharedApplication] keyWindow];
but it returned zero.
I also tried:
UIWindow* mWindow = (UIWindow*)[[UIApplication sharedApplication].windows objectAtIndex:0];
But this caused an exception and the application closed when I tried to print
[[UIApplication sharedApplication].windows count]
Printed 0
Note. I put this in my only viewDidLoad method of the view controller, and this is a completely new application for the iPad iPad, so I havenβt changed anything, just trying to get the window
Please help me get this object.
iphone uiwindow uiapplication
user416445 Sep 23 '10 at 19:56 2010-09-23 19:56
source share