出于某种原因,XCode 的表现非常奇怪。我一直在测试 XCode 加载带有 -hd 后缀的图像的能力,并意识到 Xcode 将加载一个文件“welcomeBackground.jpg”,而不管它是否真的在我的项目文件夹中。
看,下面这段代码在编译时不会崩溃。这是应用加载时显示的第一个屏幕。我从我的项目文件夹中删除了文件“welcomeBackground.jpg”,XCode 仍然加载该文件,就好像它在那里一样。
这真的吓到我了。请帮忙?
我 200% 确定我从项目文件夹中删除了该文件,但 Xcode 并没有在第 35 行崩溃。
EDIT: To repeat, things I have tried/checked
- Cleaned project
- Deleted Derived Data
- Checked for hidden files in project folder
- Deleted app from iPhone and re-run from XCode
- Deleted the files from my project folder
- Loaded another image "sadhieia.png" and crashed Xcode
because Xcode couldn't find the file (as it does not
exist), and then tried "welcomeBackground.jpg" again
and Xcode somehow finds it.
然而,背景仍然加载......