views:

168

answers:

1

In some cases [[ UIApplication sharedApplication] keyWindow ] returns nil.

On some devices it's happening pretty often but in general it's sporadic

Anyone know the reasons it would return nil?

+2  A: 

...When happens a transition form one window to another, i suppose. Users can't see any transitions, but they happen.

In iPhone OS 2.0 to iPhone 3.1.3, one example is immediately after you sent the message play to a MPMoviePlayerController instance:

[[[MPMoviePlayerController alloc]initWithContentURL:[@"http://someurl"]]play];

There might be also other situations.

mxg
thank you a lotbut in our case Movie Player doesn't using
dniprodev
+1 I'm pretty sure all the system provided modal views do this. The image picker view for example. You will get it before the window loads in the app delegate as well.
TechZen