0

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?

TechZen
  • 64,370
  • 15
  • 118
  • 145
dniprodev
  • 1
  • 2

1 Answers1

2

...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
  • 20,946
  • 12
  • 59
  • 80
  • 1
    +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 Jun 11 '10 at 12:48