OSX上的IBOutletCollections和Interface Builder [英] IBOutletCollections and Interface Builder on OSX

查看:98
本文介绍了OSX上的IBOutletCollections和Interface Builder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 NSViewController ,我希望在其中创建一个 IBOutletCollection(NSTextField)

I have a NSViewController , in which I wish to create a an IBOutletCollection(NSTextField).

在我的头文件中,我介绍了这些代码行:

In my header file, I introduced these lines of code :

@property (strong) IBOutletCollection(NSTextField) NSArray *iNetworkIDOctets;

@property (strong) IBOutletCollection(NSTextField) NSArray *oWildcardOctets;

@property (strong) IBOutletCollection(NSTextField) NSArray *oSubnetOctets;

我的问题是我在界面生成器中看不到IBOutletCollection,因此,我不能将我的NSTextField项目连接到我的插座集合。

My problem is that I can't see the IBOutletCollection in Interface Builder, therefore, I can't connect my NSTextField items to my outlet collection.

普通 IBoutlet 属性工作正常。

推荐答案

不幸的是,只支持IBOutletCollection在iOS上。对于OS X,您必须为每个对象创建一个单独的插座,或者提供另一种方法来引用XIB中的文本字段。

Unfortunately, IBOutletCollection is only supported on iOS. For OS X, you'll have to create a separate outlet for each object, or else come up with an alternate way to reference the text fields in your XIB.

这篇关于OSX上的IBOutletCollections和Interface Builder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆