Xcode如何知道该项目的“创建者"? [英] How does Xcode know who the project was "created by"?

查看:100
本文介绍了Xcode如何知道该项目的“创建者"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只要将新文件添加到项目中,Xcode就会在顶部添加以下注释行.

Whenever a new file is added to the project, Xcode adds the following lines of comments on top.

//  Created by {my name here} on 8/4/11.
//  Copyright 2011 __{my company name here}__. All rights reserved.

它怎么知道我叫什么名字?是否假设我的帐户名称属于"Mike",则"Mike"是编写此代码的开发人员的名字吗?

How does it know what my name is? Does it assume that if my account name belongs to "Mike", "Mike" is the name of the developer writing this code?

然后查看通讯录,试图找出"Mike"公司在做什么?这是有道理的,但是在我的地址簿中列出的公司并不是Xcode文件中显示的公司.

Does it then look at Address Book trying to find out what company "Mike" works at? It would make sense, however company listed as part of my address book is not what shows up in the Xcode file.

有人可以在Xcode可以读取它的某个地方进行后续操作吗?

Can one set the following up in some place where Xcode will read it from?

  • 名称
  • 公司名称
  • 一些描述重要内容的其他文字

推荐答案

在地址簿中选择您自己(如果不在,则添加您自己),然后转到菜单栏中的Card-> Make This My Card.从Xcode模板创建文件时,该卡中的名称,姓氏和公司名称将用于在文件标题中填充信息.

In Address Book select yourself (or add yourself if you aren't there) and then go to Card -> Make This My Card in menu bar. The name, last name and company name from that card will be used to populate info in file headers when creating files from Xcode templates.

或者,您可以通过Terminal.app使用默认值来设置它,如下所示:

Alternatively, you could set it using defaults via Terminal.app like this:

defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME="ACME Inc.";}'

这篇关于Xcode如何知道该项目的“创建者"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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