How to give focus to NSWindow loaded from NIB?

二次信任 提交于 2019-12-04 09:37:20

Okay, I found the cause of this problem.

The xib's File's owner must be set to the controller, and (this is the part I didn't know about) you have to connect the controller's window outlet to the window itself.

Having done that, it just works. No makeKeyWindow, makeMainWindow or makeKeyAndOrderFront: needed.

Perhaps makeMainWindow: or makeKeyWindow: helps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!