Singleton NSWindowController 关闭后不会重新打开窗口
我有一个单例 NSWindowController (ProjectInfoHUDController),它在关闭后不会重新打开。我知道该对象保留在内存中,因为在窗口关闭之前和之后对 [ProjectInfoHUDController sharedInstance] 进行的任何调用都会返回相同的内存地址。 makeKeyAndOrderFront:
和 controller.window.isVisible = YES
均不执行任何操作。
I have a singleton NSWindowController (ProjectInfoHUDController) that won't reopen after it has been closed. The object is persisting in memory which I know because any calls made to [ProjectInfoHUDController sharedInstance]
both before and after the window has been closed return the same memory address. Both makeKeyAndOrderFront:
and controller.window.isVisible = YES
do nothing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
结果发现IB中的窗口没有连接。另一个教训是首先寻找明显的解决方案。
Turned out the window was not connected in IB. Another lesson in looking for the obvious solution first.