无法在 Xcode 中重命名组文件夹

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

Unable to rename a group folder in Xcode

xcodeide

提问by max_

I added a new group from selection today in Xcode containing several files. For some reason, this has consisted for a while, I am unable to name or rename the group folder.

我今天在 Xcode 中从选择中添加了一个新组,其中包含多个文件。出于某种原因,这已经有一段时间了,我无法命名或重命名组文件夹。

Has this happened to anyone else before, if so have you come across a fix?

以前有没有其他人遇到过这种情况,如果有,您是否遇到过解决方法?

回答by Paul.s

What have you tried to do in order to rename it?

您尝试过什么来重命名它?

The contextual menu (right click) does not provide a rename option. Therefore I either

上下文菜单(右键单击)不提供重命名选项。因此我要么

  1. Select the group
  2. Hit return which selects it for editing
  1. 选择组
  2. 点击返回选择它进行编辑

OR

或者

  1. Select the group
  2. After a short delay (long enough to not count as a double click) click it again
  1. 选择组
  2. 短暂延迟后(足够长的时间不算是双击)再次单击它

回答by Dev Vanana

Sometimes it happens.

有时候这种情况会发生。

Workaround:

解决方法:

  1. Quit Xcode.
  2. Launch Xcode. Tada
  1. 退出 Xcode。
  2. 启动 Xcode。 多田

回答by scord

For anyone that has my issue: Check your files in Finder. I had a folder that was already using that name. Delete that folder and it will allow you to change name.

对于遇到我问题的任何人:在 Finder 中检查您的文件。我有一个已经在使用该名称的文件夹。删除该文件夹,它将允许您更改名称。

回答by aph340

You cannot rename the folder probably because that folder already exists in that directory.

您无法重命名文件夹,可能是因为该文件夹已存在于该目录中。

To solve it:

要解决它:

  1. Select the folder you want to rename, press the right button, press show in finder.
  2. Delete the folder(s) that already have the name you want.
  3. Go to Xcode and try again.
  4. Good luck :)
  1. 选择要重命名的文件夹,按右键,在查找器中按显示。
  2. 删除已有名称的文件夹。
  3. 转到 Xcode 并重试。
  4. 祝你好运 :)

回答by Hossein

Some times 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 ls in terminal.

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

How to solve this?

如何解决这个问题?

Open terminal and navigate to parent directory of desired directory : cd ~/../parent or just right click parent directory and choose New Terminal at Folder Remove desired directory : rm -rf MyGroup Now you can try to create your group with MyGroup name.

打开终端并导航到所需目录的父目录: cd ~/../parent 或只需右键单击父目录并在文件夹中选择新建终端 删除所需目录: rm -rf MyGroup 现在您可以尝试使用 MyGroup 名称创建您的组。