IBOutletCollections and Interface Builder on OSX

浪尽此生 提交于 2019-12-18 04:35:19

问题


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;

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.

Normal IBoutletproperties work fine though.


回答1:


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.



来源:https://stackoverflow.com/questions/22255693/iboutletcollections-and-interface-builder-on-osx

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