简体   繁体   English

在Xcode中更改文件夹名称

[英]Changing the folder name in Xcode

屏幕截图

Is it possible to change the name of target ? 是否可以更改目标名称? For example, as shown in image, "Wonder Cars" to "Anything Else"? 例如,如图所示,“ Wonder Cars”到“ Anything Else”?

Yeah you can change the name of the Target by doing the following Steps... 是的,您可以按照以下步骤更改目标的名称...

  1. Select the new target in the TARGETS list. 在“目标”列表中选择新目标。 Press Enter to edit the text and put a more appropriate name. 按Enter键编辑文本并输入一个更合适的名称。

  2. Next, go to “Manage Schemes…”, select the new scheme you created in step 1 and press “Enter”. 接下来,转到“ Manage Schemes…”,选择您在步骤1中创建的新方案,然后按“ Enter”。 Make the scheme name the same as the new target name (which is the one you choose for the new target.) 使方案名称与新目标名称相同(这是您为新目标选择的名称)。

Click on your project (in your image, the "AccessBox" entry in the list). 单击您的项目(在图像中,列表中的“ AccessBox”条目)。 You might need to open the left sidebar in the project settings: you have a kind of "tab bar" with entries like "General", "Capabilities", "Info", etc. On the the left side of this bar is an icon that like a square with a thick line at the left side. 您可能需要在项目设置中打开左侧的边栏:您有一种“标签栏”,其中包含“常规”,“功能”,“信息”等条目。该栏的左侧是一个图标就像一个正方形,在左边有一条粗线。 If you click that, a list of your targets appears. 如果单击该按钮,将显示目标列表。

In that list, simply click on a target, then click it a second time like you do in Finder to rename a file. 在该列表中,只需单击一个目标,然后像在Finder中一样再次单击它即可重命名文件。

Please try with below step - 请尝试以下步骤-

  1. Click on your target and create new scheme from old one . 单击您的目标并从旧的计划创建新计划。

在此处输入图片说明

Or 要么

You may go to Manage Scheme and create duplicate one from old target 您可以转到“管理方案”并从旧目标创建重复的一个

  1. Select the folder you want to rename 选择要重命名的文件夹
  2. Right click on it to show a quick menu, and select "Show in Finder" 右键单击它以显示一个快捷菜单,然后选择“在Finder中显示”
  3. Rename the folder name as you want (select the folder, press return ). 根据需要重命名文件夹名称(选择文件夹,然后按回车键)。
  4. After renaming, the reference in Xcode will looks like deleted in red color. 重命名后,Xcode中的引用看起来就像是删除的红色。 Select that folder again, Cmd Delete to remove the reference ("Remove Reference", not "Move to Trash"). 再次选择该文件夹, 删除 Cmd的去除引用(“删除参考”,而不是“移动到回收站”)。 Then press Opt Cmd a to add back your renamed folder there again. 然后按Opt Cmd a再次将您重命名的文件夹添加回那里。

Btw, @shruti's solution below 顺便说一句,@ shruti在下面的解决方案

You mean to say you want to change the name of the group. 您的意思是说您想更改组的名称。 click it once then click it again but not too fast give a little gap between two clicks or click it once then in the file inspector you can change the name 单击一次,然后再次单击,但不要太快,请在两次单击之间留一点间隔,或者单击一次,然后在文件检查器中可以更改名称

will only rename it in Xcode, but the real folder name won't be changed. 只会在Xcode中对其进行重命名,但实际文件夹名称不会更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM