更改Xcode中的模板 [英] Change templates in Xcode

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

问题描述

在创建新的Cocoa类时,如何更改Xcode创建的初始模板.

How would I change the initial templates created by Xcode when creating a new Cocoa Class.

我指的是使用Xcode的新类向导创建的注释和类名.

I am referring to the comments and class name created when using Xcode's new class wizard.

推荐答案

您不会更改现有模板.换句话说,请勿在/Developer层次结构下(或您安装了开发人员工具的任何位置)修改.

You wouldn't change the existing templates. In other words, don't modify anything under the /Developer hierarchy (or wherever you installed your developer tools).

相反,请克隆您想要对其进行自定义变体的模板.然后更改它们的名称和其中的信息.最后,将它们放在您帐户的Library/Application Support文件夹中的适当位置,具体为:

Instead, clone the templates you want to have customized variants of. Then change their names and the information in them. Finally, put them in the appropriate location in your account's Library/Application Support folder, specifically:

  • 文件模板:~/Library/Application Support/Developer/Shared/Xcode/File Templates/
  • 目标模板:~/Library/Application Support/Developer/Shared/Xcode/Target Templates/
  • 项目模板:~/Library/Application Support/Developer/Shared/Xcode/Project Templates/
  • File templates: ~/Library/Application Support/Developer/Shared/Xcode/File Templates/
  • Target templates: ~/Library/Application Support/Developer/Shared/Xcode/Target Templates/
  • Project templates: ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/

这样,当您安装新的开发人员工具时,它们就不会被覆盖,您可以根据自己的意愿调整它们.

That way they won't be overwritten when you install new developer tools, and you can tweak them to your heart's content.

更新 对于较新版本的Xcode,更新后的路径为: ~/Library/Developer/Xcode/Templates/File Templates/Source

Update For newer versions of Xcode the updated path will be: ~/Library/Developer/Xcode/Templates/File Templates/Source

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

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