在 XCode 4 模板中创建子组 [英] Creating sub-groups in XCode 4 Templates

查看:31
本文介绍了在 XCode 4 模板中创建子组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然在 XCode 3 中创建模板有很多文档和示例,但将它们转换为 XCode4 模板是一场噩梦......

While there is quite a lot of documentation and example for creating templates in XCode 3 converting them to XCode4 Templates is quite a nightmare...

首先这是我发现的:

  • BorealKiss 为状态者提供了一个很好的教程
  • Cocos2d 有一些非常好的示例来制作模板更进化"
  • BorealKiss provides a nice tutorial for staters
  • Cocos2d has some very nice examples to make your templates more "evolved"

但是他们都没有回答这个示例问题:

But all of them fail to answer this sample question:

如何创建 Folders Insider 其他文件夹?

例如,如果你想在一个组中有文件,你应该写:

For example if you want to have files inside a group you should write:

<key>Definitions</key>
<dict>
    <key>File1.h</key>
    <dict>
        <key>Group</key>
        <string>Group1</string>
        <key>Path</key>
        <string>File1.h</string>
        <key>TargetIndices</key>
        <array/>
    </dict>
    <key>File1.m</key>
    <dict>
        <key>Group</key>
        <string>Group1</string>
        <key>Path</key>
        <string>File1.m</string>
    </dict>
</dict>

<key>Nodes</key>
<array>
    <string>File1.h</string>
    <string>File1.m</string>
</array>

但是,例如,您将如何将 Group1 放在 Group2 中.

but how would you go for having Group1 inside Group2 for example.

我尝试了很多很多东西,和祖先一起玩,但都没有奏效.任何建议或任何文档(我在这些 XCode 模板上找不到任何内容)将不胜感激.

I've tried many many things, playing with ancestors and all but nothing worked. Any piece of advice or any documentation (I couldn't find any on those XCode templates) would be greatly appreciated.

推荐答案

我试过很多次修改 TemplateInfo.plist 并且我也试过创建一个子组并将文件放入他们.最后我找到了解决方案:

I've tried many times modify the TemplateInfo.plist and I've also tried to make a sub group and put files in them. Finally I found the solution:

定义部分:

<key>Definitions</key>
<dict>
    <key>main.h</key>
    <dict>
        <key>Path</key>
        <string>main.h</string>
        <key>Group</key>
        <array>
            <string>parent</string>
            <string>child</string>
        </array>
    </dict>
</dict>

在节点部分:

<key>Nodes</key>
<array>
    <string>main.h</string>
</array>

上面的代码将创建父子组.并且 main.h 在孩子中

The code above will create groups parent and child. and the main.h is in the child

Project
--parent
---child
----main.h

这篇关于在 XCode 4 模板中创建子组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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