本文介绍了+ exposeBinding不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想公开自定义在NSWindowController的一个子类绑定。我增加了以下code子类:

I'm trying to expose a custom binding in an subclass of an NSWindowController. I added the following code to the subclass:

+(无效)初始化{[自exposeBinding:@customBinding]; }

然后,在IB,我有我的子类的对象实例。但是,当我看到自定义NSWindowController的绑定,我没有看到'customBinding'暴露出来。我缺少的东西吗?

Then, in IB, I have an object instance of my subclass. But, when I look at the bindings of the custom NSWindowController, I don't see the 'customBinding' exposed. Am I missing something?

推荐答案

这些方法是在传统界面生成器仅插件使用。 X $ C $的C 4不正式支持插件。您可以选择使用创建code这些绑定 -bind:toObject:withKeyPath:选择: 。 键入任何你喜欢的部分仅适用于您绑定的关键路径,而不是绑定名称本身。

These methods are for use in legacy Interface Builder plug-ins only. Xcode 4 doesn't officially support plug-ins. You have create these bindings in code using -bind:toObject:withKeyPath:options:. The "type whatever you like" part only applies to the key paths you bind to, not to the binding names themselves.

这篇关于+ exposeBinding不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 06:16