makeKeyAndVisible

来源:互联网 发布:图片文字抓取软件 编辑:程序博客网 时间:2024/04/28 11:50

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.

我不知道为什么,不过有人搜索makeKeyAndVisible方法。其实我这种懒人一般不会刨根问底,有些方法照打就好,那些白给的方法有些就别动就好了。

我们看看这个每个程序都有的方法吧:

[window makeKeyAndVisible];

由于iPhone是单窗口程序,所以也就只有这么一个Window对象,而且是UIWindow,不是NSWindow。而根据文档上所说:

“这个是便捷方法,去使被使用对象的主窗口显示到屏幕的最前端。你也可以使用hiddenUIView方法隐藏这个窗口”

所以基本上来说,对于编程者的区别仅仅在于在其前添加代码,或在其后添加代码。



原创粉丝点击