我们看看这个每个程序都有的方法吧:
由于iPhone是单窗口程序,所以也就只有这么一个Window对象,而且是UIWindow,不是NSWindow。而根据文档上所说:
“这个是便捷方法,去使被使用对象的主窗口显示到屏幕的最前端。你也可以使用hiddenUIView方法隐藏这个窗口”
所以基本上来说,对于编程者的区别仅仅在于在其前添加代码,或在其后添加代码。
makeKeyAndVisible
Makes the receiver the key window and makes that window visible.
- (void)makeKeyAndVisible
Discussion
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 inheritedhidden
UIView
property.
Availability
- Available in iPhone OS 2.0 and later.