将文件所有者连接到应用程序委托 [英] Connecting file owner to app delegate
问题描述
出于某种原因,出于某种原因,我从XIB中将对象删除到我的appdelegate文件中.我添加了一个新对象,然后选择MyAppNameDelegate作为类.但是,它没有连接到文件所有者,并且右键单击并拖动时似乎没有得到该选项.我认为这导致了一些运行时问题.有什么想法吗?
At some point I deleted the Object to my appdelegate file for some reason from the XIB. I added a new object, and selected MyAppNameDelegate as the class. However, it's not connected to file owner, and I dont seem to get the option when right clicking and dragging. I think this is causing me some runtime issues. Any ideas?
推荐答案
如果您引用MainMenu,则文件的所有者是NSApplication类型的对象.
If you are referring to your MainMenu, the the file's owner is an object of type NSApplication.
在IB中,您应该选择文件的所有者,访问文件的代理"出口,并将其拖动(如画线)到应用程序委托中.这将恢复连接.
In IB, you should select your file's owner, access it's 'delegate' outlet and drag it (as to draw a line) to your app delegate. This will restore the connection.
还要检查文件的所有者是否具有NSApplication类类型.也许它有所改变.
Check also that your file's owner has got the NSApplication class type. Maybe it got changed somehow.
这篇关于将文件所有者连接到应用程序委托的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!