我如何知道何时在 MonoMac 中设置了控制插座?
基本上,在我的应用程序的初始化中,我想在加载控件后设置其属性的值。在 MonoMac 中,当调用 MainWindowController
的 Initialize
方法时,控制出口不一定可用(它们为 null)。
我找不到任何可以侦听的事件,例如 LoadComplete
,然后对控件进行所需的初始化。
Basically, in my application's initialization, I want to set the value of a control's property once it has been loaded. In MonoMac, it appears that when the MainWindowController
's Initialize
method is called, the control outlets are not necessarily available (they are null).
I couldn't find any events such as LoadComplete
that I could listen on and then do the required initialization on my control.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在
MainWindowController
类中使用AwakeFromNib
方法。一旦所有对象都已加载并连接,就会调用它。You should use the
AwakeFromNib
method in yourMainWindowController
class. It is called once all the objects have been loaded and connected.