sagarkothari
sagarkothari

Reputation: 24820

makeKeyAndVisible & makeKeyWindow - uiwindow in iphone

In every application,

there is always written as [window makeKeyAndVisible];

What is mean by makeKey?

Upvotes: 21

Views: 22704

Answers (4)

Erhan Demirci
Erhan Demirci

Reputation: 4209

Makes the receiver the key window and makes that window visible.

This is a convenience method to make the receiver the main window and displays it in front of other windows. You can also hide and reveal a window using the inherited hidden property of UIView.

source: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html

Upvotes: 2

Steve Weller
Steve Weller

Reputation: 4619

This method call performs a critical function. If you omit it then the top level view to the window will not be autoresized however you have set the springs and struts. Took me a while to figure that out: if the in-call status bar resizing is not happening, check to see that the window is marked as key.

Upvotes: 3

Rob
Rob

Reputation: 1288

The key window is the window which will receive user interaction.

You might take a look at this:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html

Upvotes: 24

Alex
Alex

Reputation: 26859

This means that this is the window that accepts keyboard input. This matches similar nomenclature on Mac OS X.

Upvotes: 5

Related Questions