简体   繁体   English

XCode 4 Interface构建器中的定制对象/类

[英]Custom Object/Class in XCode 4 Interface builder

Im using Xcode 4. In interface builder of my project, I pulled a custom Object (gold cube) from library. 我正在使用Xcode4。在我的项目的界面生成器中,我从库中提取了一个自定义对象(金立方体)。 I named its class as MyController and did the same for its label. 我将其类命名为MyController并对其标签进行了相同的操作。 I saved these settings then. 然后,我保存了这些设置。

But I'm not able to write this class to the project's class files. 但是我无法将此类写入项目的类文件中。 I mean I cannot generate class file from this custom object I pulled from the objects library. 我的意思是我无法从我从对象库中提取的此自定义对象生成类文件。 I wanted it to inherit from NSObject alone and I want to tie up some outlets. 我希望它单独从NSObject继承,并且我想捆绑一些渠道。

How do I do this in Xcode 4? 如何在Xcode 4中做到这一点? Please help. 请帮忙。 The help documentation regarding this topic is not good. 关于此主题的帮助文档不好。

The cubes you see in Interface builder for objects are not there to generate code, they are there to represent objects. 您在“接口构建器”中看到的对象的多维数据集不用于生成代码,它们用于表示对象。

You need to create the class normally and then configure the block to be an object of this class. 您需要正常创建该类,然后将块配置为该类的对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM