本文介绍了如何删除UIWindow?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为很容易,因为 [myWindow resignKeyWindow] [self.window makeKeyAndVisible]

I thought it was easy as [myWindow resignKeyWindow] and [self.window makeKeyAndVisible] but I guess not… Would you guys know what to do?

感谢:)

推荐答案

p>不要直接调用 -resignKeyWindow ,它意味着当你的UIWindows被删除时,被覆盖执行一些代码。为了删除旧窗口,您需要创建UIWindow的新实例,并使它 -makeKeyAndVisible ,旧窗口将会退出其关键状态。在iOS 4中,它甚至会垃圾收集您的旧 UIWindow ,前提是您没有任何引用。在iOS 3.x中这样做会有灾难性的影响。警告ya。

Do not invoke -resignKeyWindow directly, it was meant to be overridden to execute some code when your UIWindows gets removed. In order to remove old window you need to create new instance of UIWindow and make it -makeKeyAndVisible, the old window will resign its key status. In iOS 4 it will even garbage collect your old UIWindow, provided you don't have any references to it. Doing this in iOS 3.x would have disastrous effects. Warned ya.

这篇关于如何删除UIWindow?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 01:37