更改 Xcode 项目模板 [英] Make changes to Xcode project templates

查看:36
本文介绍了更改 Xcode 项目模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了一些关于创建/编辑 Xcode 项目模板的帖子,但它们似乎不适用于 Xcode 5.

I have read a few posts about creating/editing Xcode project templates, but they don't seem to work with Xcode 5.

我必须在其中进行更改的目录是/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate

The directory in which I have to make changes is, /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate

但是,我想不出哪里可以进行更改并包含我希望添加的头文件和其他语句.

However, I can't figure out a place where I can make changes and include the header files and other statements that I wish to add.

我什至尝试在文件模板中编辑 C++ 类.但是,问题是只有当我向项目添加新的 c++ 类时,自定义类才会发挥作用.main.cpp 中没有可见的变化

I have even tried editing C++ class in the File Template. However, the problem is that the custom class comes into play only when I add a new c++ class to the project. No changes are visible are in main.cpp

推荐答案

这里有项目文件,它设置了所需的基本文件,而不是额外的文件.

You have the project file here which sets up the base files needed and not extra files.

当您添加新文件时,您会在 /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates

When you add a new file you us a template under /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates

要为 C++ 类执行此操作,请将 /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/C 和 C++/C++ Class.xctemplate 复制到 ~//Library/Developer/Xcode/Templates/File Templates/<myGroup>/C++ File.xctemplate(替换为您想要的组名.然后编辑此目标目录中的文件.

To do this for a C++ class copy /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate to ~//Library/Developer/Xcode/Templates/File Templates/<myGroup>/C++ File.xctemplate (replacing by the group name you want. Then edit the files in this target directory.

这篇关于更改 Xcode 项目模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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