Xcode 更改/删除注释模板
最近我一直在学习如何进行C 编程。大部分时间我一直在使用C 版本的Eclipse。最近,我尝试了 Xcode。我使用的 Mac 运行 Mac OS X Lion - Xcode 版本 4.1。
我有一个不满:在我创建的每个文件的顶部,有一小部分注释我希望删除或更好地更改。
当我创建文件时,默认情况下,类似的内容会放在文件的顶部:
//
// FILE.c
// PROJECT NAME
//
// Created by Martin Tuskevicius on DATE.
// Copyright YEAR ORGANIZATION (my school name for some reason). All rights reserved.
//
显然大写的内容将被替换为实际值。对于那些已经使用或曾经使用过 Xcode 进行 C 编程的人,您知道如何更改或删除这些默认注释吗?
我真的很感谢任何帮助。 谢谢!
Recently I've been learning how to program C. For most of the time, I have been using the C version of Eclipse. Recently, I tried out Xcode. I am using a Mac running Mac OS X Lion - Xcode version 4.1.
There is one grievance I have: at the top of every file that I create, there is this little section of comments that I wish to remove or better yet, change.
When I create a file, something like this is put at the top of the file by default:
//
// FILE.c
// PROJECT NAME
//
// Created by Martin Tuskevicius on DATE.
// Copyright YEAR ORGANIZATION (my school name for some reason). All rights reserved.
//
Obviously the things in capitals would be replaced with an actual value. For those of you have use, or have used Xcode, for programming C - do you know a way of how to change or remove these default comments?
I really appreciate any help.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更新:
根据下面@Michael Dautermann的评论,更改Xcode.app包中的模板不是一个好方法。请查看 https://stackoverflow.com/a/33743/380774 了解更多信息。
您可以删除或更改文件模板中的标题,我使用的是 Xcode 4.3,文件模板位于
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates
。UPDATE:
According to @Michael Dautermann 's comment below, change templates in Xcode.app bundle is not a good way. Check https://stackoverflow.com/a/33743/380774 for more information.
You can remove or change the header in File Templates, I'm using Xcode 4.3, and the File Templates is in
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates
.请不要在 Xcode 内编辑文件,这会破坏应用程序签名,并导致 Xcode 在下次重新启动后拒绝启动。
创建一个
IDETemplateMacros.plist
文件,其中包含一个带有FILEHEADER
键(字符串)的字典。您可以将该文件
xcshareddata
文件夹(例如MyAppWorkspace.xcworkspace/xcshareddata/IDETemplateMacros.plist
)中,供单个项目上的所有用户MyAppWorkspace.xcworkspace/xcuserdata/YOURNAMEHERE.xcuserdatad
~/Library/Developer/Xcode/UserData/
中来在帐户中打开的项目Please do not edit files inside Xcode, that will break the application signature and will cause Xcode to refuse to start up after the next restart or so.
Create an
IDETemplateMacros.plist
file containing a dictionary with aFILEHEADER
key (string) instead.You can put the file in
xcshareddata
folder (e.g.MyAppWorkspace.xcworkspace/xcshareddata/IDETemplateMacros.plist
)MyAppWorkspace.xcworkspace/xcuserdata/YOURNAMEHERE.xcuserdatad
~/Library/Developer/Xcode/UserData/
您可以在 Xcode 项目文件中更改它。
这是我的教程图片:D
很容易!
You can change it in Xcode project File.
This is my image for tutorial :D
Very easy!!!