在 XCode 中更改项目文件夹名称后出现错误

Joh*_*Doe 5 xcode ios swift

当我创建项目时,我将其命名为“Project1”。然后,后来我从 Xcode 将其更改为“Project2”。我将所有“Project1”更改为“Project2”,但是现在,当我编译项目时,它会查找其中的文件,Project2/Project1/myFile.swift然后出现下一个错误:

<unknown>:0: error: no such file or directory: '/Users/myusername/Copy/Projects/Project2/Project1/myFile.swift'
Run Code Online (Sandbox Code Playgroud)

我需要让它看起来

/Users/myusername/Copy/Projects/Project2/myFile.swift
Run Code Online (Sandbox Code Playgroud)

没有Project1在路径中。

我怎么解决这个问题?另外,我从项目的XcodeIdentity and Type部分进行了更改。Location

Avi*_*are -1

  1. 将查找器中的文件夹名称“Project1”更改为“Project2”

  2. 从项目中删除“myFile.swift”文件(复制到桌面上)

  3. 重新启动 Xcode。在项目中复制“myFile.swift”,选择“将文件复制到文件夹”希望这会有所帮助。