views:

33

answers:

2

how can I get the topmost view at any time in iphone sdk4?

+2  A: 

Hi,

it would be helpful if you ask your question a bit more in detail, but anyway you can try it with this line of code:

UIView *topMostView = [[[[UIApplication sharedApplication] keyWindow] subviews] objectAtIndex:0];

cheers, anka

anka
Thanks Anka. I am sure this will be useful at a later time.
A: 

I was looking for answer to another thread here. Problem of returning UIKeyBoard object was because; while it was a UIView in older SDK, it is UIWindow in iphone SDK 4. Problem solved.