简体   繁体   English

如何重命名我的ios项目驻留在我的OS上的文件

[英]how to rename file that my ios project resides in on my OS

I am using Finder to navigate to the destination that my ios project sits in. There are two files that I would like to rename the main one it is in and then the sub file with the same name as the main one. 我正在使用Finder导航到我的ios项目所在的目标。有两个文件我想重命名它所在的主文件,然后是与主文件同名的子文件。

I have tried just right clicking and renaming but then when I open my project all of the files inside the navigator are red and cannot be clicked. 我已经尝试过右键单击并重命名,但是当我打开项目时,导航器中的所有文件均为红色,无法单击。

Is there any way to do this or am I out of luck? 有什么办法可以做到吗?还是我不走运?

**edit, I can change the name of my main file without buggering up all of the files inside, however the subfile that actually has all of the files in it cannot be changed. **编辑,我可以更改我的主文件的名称,而不会纠结其中的所有文件,但是实际上包含所有文件的子文件不能更改。

If you look below I would like to change the name of testTable2 but if I do that when you go back into xcode all the file names appear red. 如果您在下面看,我想更改testTable2的名称,但是如果我这样做,当您回到xcode时,所有文件名都显示为红色。 在此处输入图片说明

在XCode中,如果单击选定的文件,则可以像在Finder中一样更改文件的名称,并且它会自动将项目更改为指向新文件。

Rename the files from within Xcode. 在Xcode中重命名文件。 Select the file name, wait a second, click it again and the name will become editable. 选择文件名,稍等片刻,再次单击它,文件名将变为可编辑的。 The file is renamed on disk and in the project. 该文件在磁盘上和项目中被重命名。

When you rename a file outside of Xcode that is part of an Xcode project, Xcode has no way of knowing what you did, so the file (with it's old name) appears in red in Xcode, meaning "I can't find this file." 当您将Xcode外部的文件重命名为Xcode项目的一部分时,Xcode无法知道您的操作,因此该文件(具有旧名称)在Xcode中以红色显示,表示“我找不到此文件“。 In this case, you would have to remove that reference in the Xcode project and re-add the file (with it's new name). 在这种情况下,您将必须在Xcode项目中删除该引用,然后重新添加文件(使用新名称)。

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

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