Xcode 4模板,创建空组
我正在尝试创建一个 xcode 4 模板。除了我无法创建空组之外,一切工作正常。
我想要这个项目结构: 项目名称 -模型 -控制器 - 景观 -Services
<key>Definitions</key>
<dict>
<key>Views/RootViewController.h</key>
<dict>
<key>Group</key>
<string>Controllers</string>
<key>Path</key>
<string>RootViewController.h</string>
<key>TargetIndices</key>
<array/>
</dict>
<key>Views/RootViewController.m</key>
<dict>
<key>Group</key>
<string>Controllers</string>
<key>Path</key>
<string>RootViewController.m</string>
</dict>
<key>en.lproj/RootViewController.xib</key>
<dict>
<key>Group</key>
<string>Views</string>
<key>Path</key>
<string>RootViewController.xib</string>
</dict>
<key>en.lproj/MainWindow.xib</key>
<dict>
<key>Group</key>
<string>Views</string>
<key>Path</key>
<string>MainWindow.xib</string>
</dict>
<key>Services</key>
<dict>
<key>Group</key>
<string>Services</string>
<key>Path</key>
<string>Services</string>
<key>TargetIndices</key>
<array/>
</dict>
</dict>
<key>Nodes</key>
<array>
<string>en.lproj/MainWindow.xib</string>
<string>Views/RootViewController.h</string>
<string>Views/RootViewController.m</string>
<string>en.lproj/RootViewController.xib</string>
<string>Services</string>
</array>
Views 组被创建,因为文件被添加到此文件夹中。
服务组也会被创建,但其中有一个名为“服务”的文件(没有扩展名)。
I'm trying to create a xcode 4 template. Everything works fine except for the fact that I can't create an empty group.
I would like to have this project structure:
ProjectName
-Models
-Controllers
-Views
-Services
<key>Definitions</key>
<dict>
<key>Views/RootViewController.h</key>
<dict>
<key>Group</key>
<string>Controllers</string>
<key>Path</key>
<string>RootViewController.h</string>
<key>TargetIndices</key>
<array/>
</dict>
<key>Views/RootViewController.m</key>
<dict>
<key>Group</key>
<string>Controllers</string>
<key>Path</key>
<string>RootViewController.m</string>
</dict>
<key>en.lproj/RootViewController.xib</key>
<dict>
<key>Group</key>
<string>Views</string>
<key>Path</key>
<string>RootViewController.xib</string>
</dict>
<key>en.lproj/MainWindow.xib</key>
<dict>
<key>Group</key>
<string>Views</string>
<key>Path</key>
<string>MainWindow.xib</string>
</dict>
<key>Services</key>
<dict>
<key>Group</key>
<string>Services</string>
<key>Path</key>
<string>Services</string>
<key>TargetIndices</key>
<array/>
</dict>
</dict>
<key>Nodes</key>
<array>
<string>en.lproj/MainWindow.xib</string>
<string>Views/RootViewController.h</string>
<string>Views/RootViewController.m</string>
<string>en.lproj/RootViewController.xib</string>
<string>Services</string>
</array>
The Views group gets created, because files get added to this folder.
The Services group also gets created but there is a file called 'Services' in it (without an extension).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我来得有点晚了,但我刚刚得到了自己测试的答案。
您几乎是正确的,您只需要删除文件夹的组密钥即可。 XCode 将自行创建组。例如,仅服务的代码将如下所示:
就是这样,我希望它会对您或其他任何人有所帮助。
以防万一有人想尝试其他选项创建一个示例项目,然后重命名所有文件名和内容,请在我使用的 bash 脚本下面找到附件:
在这种情况下,我首先创建了示例项目,并将其称为
___PACKAGENAME___
之后,我只是更改了文件中的一些其他字段(例如日期),以便能够使用脚本更改它们。该代码是在 2013 年 4 月创建的,所以自从我上次使用它以来已经有一段时间了,现在我没有那么多时间来审查和检查是否一切正常。但如果其他人对这个工作原理感兴趣,我想我将能够找到一个缺口将所有内容上传到 Github。
I suppose I arrive a little bit late but I just got the answer testing it on my own.
You have it almost correct, you only need to delete the group key for the folders. XCode will create the groups on its own. For example the code for only Services will be like this:
That's it, I hope it will help you or anybody else.
Just in case anybody wants to try the other option creating a sample project and then renaming all the file names and content, find attached below the bash script I was using:
In this case, I created first the sample project and I call it
___PACKAGENAME___
after that I just changed some other fields inside the files like the date in order to be able to change them with the script.This code was created at April 2013 so it's been a while since the last time I used it and right now I don't have so much time to review and check if everything is ok. But if anybody else is interested in how this work I guess I will be able to find a gap to upload everything to Github.