xcode 我在哪里设置我的公司名称?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2956464/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where do I set my company name?
提问by TheLearner
When creating new source files xcode adds comments with your name and company name.
创建新源文件时,xcode 会添加带有您的姓名和公司名称的注释。
Where do I set my company name for xcode (not the project).
我在哪里为 xcode(不是项目)设置我的公司名称。
采纳答案by WINSergey
回答by slf
in Xcode 4 GM seed:
在 Xcode 4 GM 种子中:
in the navigation pane (far left side), select the project (top item).
Expand the Utilities pane (at window top-right, far right button in the 3-button "View" group).
In the "Project Document" section is the "Organization" text field (File Inspection view, second section from top).
在导航窗格(最左侧)中,选择项目(顶部项目)。
展开实用程序窗格(在窗口右上角,三按钮“查看”组中最右侧的按钮)。
在“项目文档”部分是“组织”文本字段(文件检查视图,从顶部的第二部分)。
回答by VoodooChild
By default, Xcode inserts a company name something similar to the following in all new source files (.m .h etc):
Copyright (c) 2009 MyCompanyName. All rights reserved.
Changing this reference is as simple as entering the following from within a terminal window, replacing “YourNameHere” with the text you prefer. Also, make sure this is all entered on one line in the terminal.
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME="YourNameHere";}'
默认情况下,Xcode 会在所有新源文件(.m .h 等)中插入类似于以下内容的公司名称:
版权所有 (c) 2009 MyCompanyName。版权所有。
更改此引用就像在终端窗口中输入以下内容一样简单,将“YourNameHere”替换为您喜欢的文本。此外,请确保在终端的一行中输入所有内容。
默认写 com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME="YourNameHere";}'
OR
或者
you could even go to ~/Library/Preferences and double-click com.apple.Xcode.plist and use the handy-dandy plist editor to set this and a whole bunch of other interesting defaults not covered by the Xcode or IB preference panels.
您甚至可以转到 ~/Library/Preferences 并双击 com.apple.Xcode.plist 并使用方便的 plist 编辑器来设置它以及 Xcode 或 IB 首选项面板未涵盖的一大堆其他有趣的默认值。
OR
或者
@slf answeron this question shows an improved way to achieve this in Xcode 4 (Pasted below)
@slf对此问题的回答显示了在 Xcode 4 中实现此目的的改进方法(粘贴在下面)
in the navigation pane (far left side), select the project (top item).
Expand the Utilities pane (at window top-right, far right button in the 3-button "View" group).
In the "Project Document" section is the "Organization" text field (File Inspection view, second section from top).
在导航窗格(最左侧)中,选择项目(顶部项目)。
展开实用程序窗格(在窗口右上角,三按钮“查看”组中最右侧的按钮)。
在“项目文档”部分是“组织”文本字段(文件检查视图,从顶部的第二部分)。
回答by Objective Ciao
I have tested on the Xcode 4.2 Beta 7 (iOS 5.0).
我已经在 Xcode 4.2 Beta 7 (iOS 5.0) 上进行了测试。
It seems like the Xcode does not retrieve ORGANIZATIONNAME from neither
似乎 Xcode 没有从两者中检索 ORGANIZATIONNAME
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions
'{ORGANIZATIONNAME="YourNameHere";}'
默认写 com.apple.Xcode PBXCustomTemplateMacroDefinitions
'{ORGANIZATIONNAME="YourNameHere";}'
nor
也不
~/Library/Preferences/com.apple.Xcode.plist
~/Library/Preferences/com.apple.Xcode.plist
The proper solution is to update your name & company name in Address Book.
正确的解决方案是在地址簿中更新您的姓名和公司名称。
Then you can try by creating any new Xcode project:
然后你可以尝试创建任何新的 Xcode 项目:
回答by florianbuerger
Or you can set the company name in youraddress card in the Mac OS X address book application. Worked for me (SL, Xcode 3.2.2)
或者你可以在设置公司名称您在Mac OS X的地址簿应用程序地址卡。对我来说有效(SL,Xcode 3.2.2)
回答by Sergio Nacht
Adding to what SLF wrote above:
添加到上面 SLF 写的内容:
in Xcode 4 GM seed:
in the navigation pane (far left side), select the project (top item).
Expand the Utilities pane (at window top-right, far right button in the 3-button "View" group).
In the "Project Document" section is the "Organization" text field (File Inspection view, second section from top).
在 Xcode 4 GM 种子中:
在导航窗格(最左侧)中,选择项目(顶部项目)。
展开实用程序窗格(在窗口右上角,三按钮“查看”组中最右侧的按钮)。
在“项目文档”部分是“组织”文本字段(文件检查视图,从顶部的第二部分)。
But there is a small catch:
但有一个小问题:
Changing the Organization name as SLF described didn't set the project file as modified and no changes where saved.
将组织名称更改为 SLF 描述并没有将项目文件设置为已修改且未保存任何更改。
You need to make a small change to the project, like adding a group after you change the organization name, this will cause Xcode 4 to save the file.
您需要对项目进行一些小的更改,例如更改组织名称后添加一个组,这将导致 Xcode 4 保存文件。
Also if you are working on a workspace, you need to make the change for each project.
此外,如果您在工作区工作,则需要为每个项目进行更改。
Tested at XCode 4.0.2
在 XCode 4.0.2 测试
回答by iCharlie
If you want change __MyCompanyName__ in Xcode 4, you can try the following command.
如果您想在Xcode 4 中更改 __MyCompanyName__ ,您可以尝试以下命令。
defaults write com.apple.dt.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME="YourNameHere";}'
默认写com.apple。dt.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME="YourNameHere";}'
Carefully, this writes in the domain, com.apple.dt.Xcode, not com.apple.Xcode
小心,这写在域中,com.apple。dt.Xcode,而不是 com.apple.Xcode
I only test on Xcode 4 pre3 and it works.
我只在 Xcode 4 pre3 上进行测试,它可以工作。
回答by rahulchona
Simply just go to appName-Info.plist and add a field "Copyright(human-readable)" : nameOfDeveloper or companyName.
:
只需转到 appName-Info.plist 并添加一个字段“版权(人类可读)”:nameOfDeveloper 或 companyName。
:
回答by Alex
In XCode 5 you can select company name on project creation. If you would like to change company name for existing project, then:
在 XCode 5 中,您可以在项目创建时选择公司名称。如果您想更改现有项目的公司名称,则:
- Open .xcodeproj in Finder by selection "Show package contents"
- Open project.pbxproj in TextEdit
- Replace current value of ORGANIZATIONNAME with desired one.
- 通过选择“显示包内容”在 Finder 中打开 .xcodeproj
- 在 TextEdit 中打开 project.pbxproj
- 将 ORGANIZATIONNAME 的当前值替换为所需的值。
回答by Korutech App Solutions
There's more confusion about this than there should be. I clarified here: https://stackoverflow.com/a/9793899/1273966I'll do the same in this thread.
对此有更多的困惑。我在这里澄清:https: //stackoverflow.com/a/9793899/1273966我会在这个线程中做同样的事情。
If the organisation name is blank in the project document (described above) the company name is pulled from the 'me' entry in your address book.
如果项目文档中的组织名称为空(如上所述),则公司名称将从地址簿中的“我”条目中提取。
If you enter an organisation name in the project document as described above, it will override the company name in the address book. IE: You can override your company name on a per project basis. Pretty clever, but obviously has a lot of people confused.
如果如上所述在项目文档中输入组织名称,它将覆盖地址簿中的公司名称。IE:您可以在每个项目的基础上覆盖您的公司名称。相当聪明,但显然有很多人感到困惑。