Xcode 4.2 (Snow Leopard) 构建警告“丢失文件”

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

Xcode 4.2 (Snow Leopard) Build Warning "Missing File"

iosxcodebuildwarnings

提问by DSDev

I recently deleted a viewcontroller from my project (both .h and .m files) but know I get a 'missing file' warning every time I build.

我最近从我的项目(.h 和 .m 文件)中删除了一个视图控制器,但我知道每次构建时都会收到“丢失文件”警告。

Any ideas on this and is it something I need to worry about?

关于这个的任何想法,这是我需要担心的事情吗?

Appreciated

赞赏

回答by Joel

This is probably a version control issue if you are using svn or git. I had this problem and solved it using the solution provided in this post:

如果您使用 svn 或 git,这可能是版本控制问题。我遇到了这个问题并使用这篇文章中提供的解决方案解决了它:

Missing file warnings showing up after upgrade to XCode 4

升级到 XCode 4 后出现丢失文件警告

回答by Ruchira Randana

I recently faced the same scenario. Adding and deleting did not work for me. However, I added them once more and right clicked on them. Under source control, I Discarded the changes and then deleted the files(Move to trash). This worked for me !!!

我最近遇到了同样的情况。添加和删​​除对我不起作用。但是,我再次添加了它们并右键单击它们。在源代码控制下,我放弃了更改,然后删除了文件(移至垃圾箱)。这对我有用!!!

回答by Tom van der Woerdt

Ensure that it's not referenced anywhere in the project.

确保没有在项目中的任何地方引用它。

  • Look at the files on the bar on the left, make sure it's not there. Missing files are colored in red.
  • Ensure that none of your files #importthe file.
  • 查看左侧栏上的文件,确保它不在那里。丢失的文件以红色显示。
  • 确保您的文件中没有任何#import文件。

Also, in the future, avoid storing files in parent directories. ../../isn't something you want to use.

此外,将来避免将文件存储在父目录中。../../不是你想使用的东西。

回答by justin

You likely have a 'dangling reference' in your target's list of files to compile or copy -- check your compile and copy phases for the target which emits the warning.

您可能在要编译或复制的目标文件列表中有一个“悬空引用”——检查发出警告的目标的编译和复制阶段。

If it's been physically deleted, the simplest way is usually to enter the file name into the project navigator's search field - look for what Tom detailed - then delete the files from the project(s).

如果它已被物理删除,最简单的方法通常是在项目导航器的搜索字段中输入文件名 - 查找 Tom 详细说明的内容 - 然后从项目中删除文件。

回答by JimmyJammed

I had a similiar problem. I was trying to delete a .h and .m and I wanted to remove the files entirely, but kept getting errors if I chose "Move to Trash" instead of just "Remove Reference".

我有一个类似的问题。我试图删除 .h 和 .m 并且我想完全删除这些文件,但是如果我选择“移至垃圾箱”而不仅仅是“删除引用”,则会不断收到错误消息。

Turns out, I needed to just delete each file INDIVIDUALLY. Just add the files back in (if you have them somewhere) and re-delete them one at a time. Worked for me!

事实证明,我只需要单独删除每个文件。只需将文件重新添加(如果您在某处有它们)并一次重新删除一个。对我来说有效!