更新 XCode 项目模板详细信息
以前所有文件头都显示如下。
// Created by ABC_User_Name on 10/31/11.
我已将用户名从 ABC_User_Name 修改为 XYZ_User_Name。
现在,即使在注销后,再次登录,我在所有项目模板中发现相同的标题。如何使用当前用户名更新这些模板?
我需要手动修改所有这些吗?
Previously all file headers were being displayed as follows.
// Created by ABC_User_Name on 10/31/11.
I have modified user name from ABC_User_Name to XYZ_User_Name.
Now, even after logging out & logging in again, I am finding the same headers in all project templates. How to update those templates with current user-name ?
Do I need to modify manually all of them ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
原始模板使用此标题:
带有双下划线的单词是占位符引用。据我所知,有 18 个,您可以在模板定义中添加更多。可以使用选项变量进一步修改这些选项。您在上面看到的内容是:
___FULLUSERNAME___
当前用户的完整用户名(姓名 + 姓氏)。__YEAR__
当前年份。___ORGANIZATIONNAME___
地址簿中显示的组织名称。您可以为每个项目更改它,选择“项目”节点并设置“组织”字段。项目创建后,标题将变为纯文本并且永远不会更新。
对于未来的项目,我建议您复制模板并在那里进行更改。否则,您可能会搞砸原始模板或让 Xcode 覆盖您的更改。
原件位于:
我在以下位置制作了副本:
其中“Jano”是我的用户,它将在新项目选择屏幕中显示为模板类别。
然后,您可以逐个文件手动编辑标头,或者使用 sed 从 bash 编辑标头。
The original templates use this header:
The words with the double underscore are placeholder references. There are 18 that I know of, and you can add more in your template definition. These options can be further modified using option variables. The ones you see above are:
___FULLUSERNAME___
Full user name of the current user (name + surname).__YEAR__
Current year.___ORGANIZATIONNAME___
The name of your organization as seen on your address book. You can change it for each project selecting the Project node and setting the Organization field.Once the project is created, the header becomes plain text and is never updated.
For future projects I suggest you duplicate the templates and do the changes there. Otherwise you risk screwing up the original templates or having Xcode overwrite your changes.
The originals are at:
And I made a copy at:
where "Jano" is my user and it will show as a template category in the new project selection screen.
Then you edit the header manually file by file, or from bash using sed.
Xcode 4 将其存储在每个项目的基础上。
如果您在项目导航器 (Cmd-1) 中选择项目并打开文件检查器 (Cmd-Opt-1),您将在“项目文档”下看到“组织”字段。
Xcode 4 stores this on a per-project basis.
If you select the project in the Project Navigator (Cmd-1) and open the File Inspector (Cmd-Opt-1), you'll see a field for "Organization" under "Project Document".