xcode 无法将“新组”重命名为“我的组”。在 Xcode10.2 中

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

Could not rename “New Group” to “ My Group”. in Xcode10.2

xcode

提问by Museer Ahamad Ansari

I just created a group and want to rename it but getting unable to update popup. I know how to rename it from show in finder. but y Apple in Xcode 10.2 does not allowed it directly from Xcode?

我刚刚创建了一个组并想重命名它但无法更新弹出窗口。我知道如何从 finder 中的显示中重命名它。但是 Xcode 10.2 中的 Apple 不允许直接从 Xcode 中获取?

Or

或者

Am i missing something? enter image description here

我错过了什么吗? 在此处输入图片说明

回答by ravin001

I was facing the same issue today. Only thing which helped me was quitting the Xcode and restarting it. It is working for me now

我今天面临同样的问题。唯一帮助我的是退出 Xcode 并重新启动它。它现在对我有用

回答by Phillip Jacobs

I just checked and found another way without restarting Xcode.

我刚刚检查并找到了另一种方法,而无需重新启动 Xcode。

I have the same issue. @ravin001 i did the same thing as you and quit and restarted Xcode but i found another way.

我有同样的问题。@ravin001 我和你做了同样的事情,退出并重新启动了 Xcode,但我找到了另一种方法。

? Go ahead and Right Clickwherever you want to create the Folder/Group.
? Select New Group.
? Press Enterto name the Folder/Group whatever Xcode suggested (usually "New Group").
? Now make sure the new Folder/Group is selected and Open the inspector panel.

? 继续,Right Click无论您想在哪里创建文件夹/组。
? 选择New Group
? Press Enter以 Xcode 建议的任何名称命名文件夹/组(通常为“新组”)。
? 现在确保选择了新的文件夹/组并且Open the inspector panel

Inspector Panel: top most right corner.

检查面板:右上角。

? The little page "file inspector" should be highlighted. If not, select it.

? 应该突出显示小页面“文件检查器”。如果没有,请选择它。

Trying to rename it won't work, First you have to rename the folder wherever it's stored.
- To do so:

尝试重命名它是行不通的,首先您必须重命名存储在任何位置的文件夹。
- 这样做:

? In the inspector panel, underneath the "location" title, you should see a folder icon. Click on that folder icon.
? Xcode will open a "choose a location" folder structure widget right in the middle of the screen.
? Right Clickon the "New Group" folder and Rename it to whatever you want.
? Click on the 'Choose' buttonto close the widget ("It's important to select choose")

? 在检查器面板中,在“位置”标题下方,您应该会看到一个文件夹图标。Click on that folder icon.
? Xcode 将在屏幕中间打开一个“选择位置”文件夹结构小部件。
? Right Click在“新组”文件夹和Rename it to whatever you want.
? Click on the 'Choose' button关闭小部件(“选择选择很重要”)

Now you rename the folder to whatever you like in Xcode

现在您可以在 Xcode 中将文件夹重命名为您喜欢的任何名称

NOTE

笔记

? Renaming the folder any other way other than through the "Choose a location" way, won't work and you still won't be able to edit the folder

? 除了通过“选择一个位置”方式以外的任何其他方式重命名文件夹都不起作用,您仍然无法编辑该文件夹

? You'll need to do this for every folder you create. So if you just created the project and will be adding a lot of folders, then it's probably best to restart xcode

? 您需要为您创建的每个文件夹执行此操作。因此,如果您刚刚创建了项目并且将添加很多文件夹,那么最好重新启动 xcode

回答by ApperleyA

I was seeing this problem today. After further investigation I determined it was due to already having folders in that directory using the same names. This was caused by creating a Group in Xcode but reverting my git changes, which didn't revert the folder creation only the Xcode Project File changes.

我今天看到这个问题。经过进一步调查,我确定这是因为该目录中已经有使用相同名称的文件夹。这是由于在 Xcode 中创建一个组但恢复了我的 git 更改引起的,这并没有恢复文件夹创建,只有 Xcode 项目文件更改。

Check in Finder that the folder/group names are unique.

在 Finder 中检查文件夹/组名称是否唯一。

回答by Rahul Gusain

i am also facing this issue. What works for me is Force Quit Xcode and restart it. Also make sure that your group should be in Right path by Right Clicking and show in Finder option.

我也面临这个问题。对我有用的是强制退出 Xcode 并重新启动它。还要确保您的组应该通过右键单击在正确的路径中并在 Finder 选项中显示。

回答by AlejandroJS

In my case the folder was already created on the filesystem but it wasn't showing on the Project Navigator.

在我的情况下,文件夹已经在文件系统上创建,但它没有显示在项目导航器上。

I only had to change the location of the "New Group" folder using the folder icon on File Inspector tab.

我只需要使用文件检查器选项卡上的文件夹图标更改“新组”文件夹的位置。

enter image description here

在此处输入图片说明

回答by KinneyKare

If you just created this group and you know for sure that the name wasn't already used in this project... Make sure the folder is not open.
You do this but looking to the left side of the folder(there is a triangle/arrow) if the triangle is pointing down, this means the folder is open and Xcode won't allow you to rename the folder.
Simply press the triangle to close it (it will be pointing towards the right when closed) and try to rename again.
You shouldn't have to exit out of Xcode!!!

如果您刚刚创建了该组并且您确定该名称尚未在该项目中使用...请确保该文件夹未打开。
您这样做,但如果三角形朝下,请查看文件夹的左侧(有一个三角形/箭头),这意味着该文件夹已打开并且 Xcode 不允许您重命名该文件夹。
只需按下三角形将其关闭(关闭时它将指向右侧)并再次尝试重命名。
你不应该退出Xcode!!!

See next to "New Group" the arrow is pointing down
see next to "New Group" the arrow is pointing down

查看“新组”旁边的箭头指向下方
请参阅“新组”旁边的箭头指向下方

Tap on the arrow and it will point to the right
tap on the arrow and it will point to the right

点击箭头,它会指向右边
点击箭头,它会指向右边

Now you are able to change the name to Controller
Now you are able to change the name to Controller

现在您可以将名称更改为 Controller
现在您可以将名称更改为 Controller

Let me know if this solved you issue.

如果这解决了您的问题,请告诉我。

回答by Hossein

I think its not related to xcode, its finder problem, because directory still exists and finder doesn't show that, you can see directory exists by entering lsin terminal.

我认为它与xcode无关,它的finder问题,因为目录仍然存在而finder没有显示,您可以通过ls在终端中输入来查看目录存在。

How to solve this?

如何解决这个问题?

  1. Open terminal and navigate to parent directory of desired directory : cd ~/../parentor just right click parent directory and choose New Terminal at Folder
  2. Remove desired directory : rm -rf MyGroup
  1. 打开终端并导航到所需目录的父目录:cd ~/../parent或只需右键单击父目录并在文件夹中选择新建终端
  2. 删除所需目录: rm -rf MyGroup

Now you can try to create your group with MyGroup name.

现在您可以尝试使用 MyGroup 名称创建您的群组。

回答by look

Ok... When you create a group it also creates a folder there. If you delete the group, the folder will not be deleted. Then if you change your mind and create the group again, it will try to create the folder again. But since the folder exists, the OS will throw an error which Xcode just reports as an inability to create the group.

好的...当你创建一个组时,它也会在那里创建一个文件夹。如果删除该组,则不会删除该文件夹。然后,如果您改变主意并再次创建组,它会再次尝试创建文件夹。但由于该文件夹存在,操作系统将抛出一个错误,Xcode 仅将其报告为无法创建组。

So just rename or delete the underlying folder and now you can rename the group. You can rearrange the files in Finder after that.

因此,只需重命名或删除基础文件夹,现在您就可以重命名该组。之后您可以在 Finder 中重新排列文件。

回答by Yeahia2508

First Restart Xcode. If restart doesn't work then check in folder that is same group name exist. If exist group delete it. Hope this two process will help to solve this issue.

首先重启Xcode。如果重新启动不起作用,则检查存在相同组名的文件夹。如果存在组删除它。希望这两个过程有助于解决这个问题。