views:

42

answers:

2

When an iPhone app with GameKit launches, and the device is already logged in to GameCenter, a small message slides in on top of the screen, saying something along the lines of "Welcome back %username!".

What I found out is the following: that message appears in its own UIWindow that eventually slides the message away and releases itself. When the message is onscreen, you can log out the following:

all windows: ( "<UIWindow: 0x31fc70; frame = (0 0; 320 480); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x31fe60>>", "<UIWindow: 0x3874c0; frame = (0 0; 320 480); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x387590>>" )

I need to distinguish the two windows in the general case -- I need something along the lines of a -(UIWindow *)topNormalWindow function that will return the topmost window that isn't either A)an alert or B)the gamecenter message. I already have a -(UIWindow *)topNonAlertWindow that determines the top window that isn't an alert, but the gamekit message isn't, but nor is it (for my purposes) a normal window.

Also, what does autoresize = RM+BM; mean?

A: 

I've been using Game Center and adding a notification system for achievements. I get the top window like this:

[[UIApplication sharedApplication] keyWindow]

Doesn't seem to conflict with alerts or the game center authentication window. In fact, my notifications get added under that window, so I think that one is on another layer above anything you can access.

Typeoneerror
A: 

I solved this problem by simply checking if the window had a GKGameEventView as a subview.

executor21