当我尝试在Xcode中重构时,会出现警告,将文件添加到此工作区中目标的构build阶段

我看到这个消息,当我尝试通过重命名重构我的代码时,

***.h is not part of the build phase of any targets in this workspace and so can't be refactored. Add the file to the build phase of a target in this workspace, or make a selection in another file.

有时,只有在重新启动Xcode并重新打开项目之后,重构才能正常工作。 但事后并不奏效。

没有成功find正确的解决scheme,我通过反复删除pipe理器>项目中的派生数据来处理这种情况