Xcode - 更改公司名称和用户名

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10245689/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:22:55  来源:igfitidea点击:

Xcode - Change Company Name and Username

xcodexcode4.2

提问by Jakub

I want to change this:

我想改变这个:

//
//  ViewController.h
//  MyApp
//
//  Created by _username on 12-04-05.
//  Copyright _company_name. All rights reserved.
//

And I tried: http://macdevelopertips.com/xcode/change-company-name-in-xcode.htmland it didn't work.

我试过:http: //macdevelopertips.com/xcode/change-company-name-in-xcode.html但它没有用。

I also tried this: http://iosdevelopertips.com/xcode/change-company-name-from-within-xcode-on-a-per-project-basis.htmlbut it did not exist in Xcode 4.

我也试过这个:http: //iosdevelopertips.com/xcode/change-company-name-from-within-xcode-on-a-per-project-basis.html但它在 Xcode 4 中不存在。

I'm using Xcode 4.2

我正在使用 Xcode 4.2

回答by Manuel

go to System preferences -> users and groups -> click on your username

转到系统首选项 -> 用户和组 -> 单击您的用户名

On that page there should be a button saying Open...click that and change that record in your contacts. When you create a new class it should get the information from that record!

在该页面上应该有一个按钮,说Open...单击该按钮并更改联系人中的记录。当您创建一个新类时,它应该从该记录中获取信息!

回答by coolbeet

For changing author name in Xcode 6, just go to User & Groupsin system preferences, right click current user (make sure permission is unlocked), select Advanced Options, change the "Full name" section.

要在 Xcode 6 中更改作者姓名,只需转到User & Groups系统首选项,右键单击当前用户(确保权限已解锁),选择Advanced Options,更改“全名”部分。

回答by AndrewS

For the User Name:

对于用户名:

Open up the address book and go to your user account, and edit your name (the large, bold line at the top). (Address Book is by default the first app in your Applications folder.)

打开地址簿并转到您的用户帐户,然后编辑您的姓名(顶部的粗线)。(默认情况下,地址簿是应用程序文件夹中的第一个应用程序。)

If you don't know which contact is your user account: Open up System Preferences. Go to Users & Groups (in the System row); your user account should already be selected. Click on the "Open..." button for the Address Book Card.

如果您不知道哪个联系人是您的用户帐户:打开系统偏好设置。转到用户和组(在系统行中);您的用户帐户应该已经被选中。单击地址簿卡的“打开...”按钮。

Changing your name in the Address Book won't change any already-created files; it will only affect new files that you create.

更改地址簿中的姓名不会更改任何已创建的文件;它只会影响您创建的新文件。

For the Company Name:

对于公司名称:

In Xcode 4, open up your project. Select the top-most item in the Project Navigator (MyProjectName, 1 target, iOS SDK 4.3 -- or whatever). Open up the file inspector (View->Utilities). In the Project Document section, you should see an "Organization" line. Edit that, and new files that you create will display the new organization name. This is a project setting, hence you'll have to do it for every project.

在 Xcode 4 中,打开您的项目。选择项目导航器中最顶层的项目(MyProjectName、1 个目标、iOS SDK 4.3 -- 或其他)。打开文件检查器 (View->Utilities)。在项目文档部分,您应该看到“组织”行。编辑它,您创建的新文件将显示新的组织名称。这是一个项目设置,因此您必须为每个项目都这样做。

For new projects that you create, the Organization Name will be whatever the value was on the previously open project. (You can edit it when creating the new project.)

对于您创建的新项目,组织名称将是先前打开的项目中的任何值。(您可以在创建新项目时对其进行编辑。)

回答by Cris

I know this question is quite old, but I have found a way to customize the template without changing the Full name. It basically consists on creating a custom plist file named IDETemplateMacros.plist, creating a new key named FILEHEADERunder Rootand putting the header text as the value. Then, you need to copy this header to one of the following locations:

我知道这个问题很老了,但是我找到了一种无需更改全名即可自定义模板的方法。它基本上包括创建一个名为 IDETemplateMacros.plist 的自定义 plist 文件,创建一个名为FILEHEADERunder的新键Root并将标题文本作为值。然后,您需要将此标头复制到以下位置之一:

  • Project user data: <ProjectName>.xcodeproj/xcuserdata/[username].xcuserdatad/

  • Project shared data: <ProjectName>.xcodeproj/xcshareddata/IDETemplateMacros.plist

  • Workspace user data: <WorkspaceName>.xcworkspace/xcuserdata/[username].xcuserdatad/

  • Workspace shared data: <WorkspaceName>.xcworkspace/xcshareddata/

  • User Xcode data: `~/Library/Developer/Xcode/UserData/``

  • 项目用户资料: <ProjectName>.xcodeproj/xcuserdata/[username].xcuserdatad/

  • 项目共享数据: <ProjectName>.xcodeproj/xcshareddata/IDETemplateMacros.plist

  • 工作区用户数据: <WorkspaceName>.xcworkspace/xcuserdata/[username].xcuserdatad/

  • 工作区共享数据: <WorkspaceName>.xcworkspace/xcshareddata/

  • 用户 Xcode 数据:`~/Library/Developer/Xcode/UserData/``

I've tried copying it to my User Xcode data folder

我试过将它复制到我的用户 Xcode 数据文件夹

More information can be found here

更多信息可以在这里找到

A full list of available macros can be found hereor looking at the Xcode help

可以在此处找到可用宏的完整列表或查看 Xcode 帮助