Xcode- 删除的图像出现在模拟器中 [英] Xcode- Deleted images appear in simulator

查看:19
本文介绍了Xcode- 删除的图像出现在模拟器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mac OS X Lion v10.7.2Xcode v4.2.1 构建 4D502gcc 版本 4.2.1(基于 Apple Inc. build 5658)(LLVM build 2336.1.00)GNU gdb 6.3.50-20050815(苹果版 gdb-1708)(2011 年 11 月 3 日星期四 21:59:02 UTC)

Mac OS X Lion v10.7.2 Xcode v4.2.1 Build 4D502 gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011)

我的资源文件夹中有一堆图像,但是当我删除这些图像并再次在模拟器中运行时,图像仍然存在.我已经从项目编辑器窗口(不是从 Finder)中完全删除了图像,并且我使用了 DELETE(不是仅删除引用),它们仍然显示在模拟器中.如果我通过项目编辑器窗口(不是来自 Finder)将新图像(名称相同)重新添加到新图像中,则旧图像仍然会被使用,而不是新图像.

I have a bunch of images in my resource folder, but when I delete those images and run in simulator again, the images are still there. I have completely deleted the images from the Project Editor window (not from Finder), and I used DELETE (not Remove Reference Only), and they are still showing up in the simulator. If I add new images back in (with the same names) thru the Project Editor window (not from Finder) the old ones are still being used as well instead of the new ones.

我试过了:

1) 从项目编辑器窗口中删除图像.

1) Deleting images from Project Editor window.

2) 从模拟器中删除应用程序(单击并按住,然后在摇晃时删除),然后重新启动计算机.

2) Delete app from simulator (click and hold, then delete while wobbling), then restart computer.

3) 选择产品 > 清洁.

3) Choosing Product > Clean.

4) 选择产品 > Option+Clean.

4) Choosing Product > Option+Clean.

5) 选择 Show Package Contents of .xcodeproj 文件,并删除 xcuserdata 文件夹中的所有内容.

5) Choosing Show Package Contents of .xcodeproj file, and deleting everything in the xcuserdata folder.

这是一个非常烦人的错误!

This is an incredibly annoying bug!

如何告诉 Xcode 停止使用缓存图像?

How do I tell Xcode to stop using cached images?

我是新手,所以像Clean Targets"这样的东西对我来说没有任何意义,除非你也给我提供了如何做的说明.

I am newbie, so something like "Clean Targets" does not mean anything to me, unless you give me the instructions on how to do it as well.

谢谢

这是我们都错过的另一个选项,它可能与删除/Simulator/../Applications 文件夹的作用相同:在 iOS Simulator 菜单中,有一个选项叫做 Reset Content and Settings ...我从来没有想过模拟器是一个独立于 Xcode 的应用程序,所以我从没想过在模拟器有焦点时检查菜单项!

Here is another option we all missed, which might do the same thing as deleting the /Simulator/../Applications folder: In the iOS Simulator menu, there is an option called Reset Content and Settings ... it never occured to me that the simulator was a separate app from Xcode, so I never thought to check menu items while simulator had focus!

推荐答案

手动删除构建文件夹可能会有所帮助.由于未知原因,清洁并不总是正确执行此操作.build 文件夹曾经在项目目录中,但现在(也)存在于 ~/Library/Developer/Xcode/DerivedData/

Manually removing the build folder may help. Clean does not always do this properly, for reasons unknown. The build folder used to be in the project directory, but now (also) exists in ~/Library/Developer/Xcode/DerivedData/

由原海报解决:

哦,等等,因为你上面的建议,我进行了一次头脑风暴,从我使用的终端: find .-name 'myimage.png' 2>/dev/null 我发现秘密隐藏的缓存!它在我的用户库中:~/Library/Application Support/iPhone Simulator/4.3.2/Applications/只需删除 Applications 目录中的所有内容.可能还需要也做这个:~/Library/Application Support/iPhone模拟器/5.0/应用程序/

Oh wait I had a brainstorm because of your suggestion above, and from Terminal I used: find . -name 'myimage.png' 2> /dev/null and I found the secret hidden cache! It is in my user library here: ~/Library/Application Support/iPhone Simulator/4.3.2/Applications/ Just delete everything in the Applications directory. May also need to do this one as well: ~/Library/Application Support/iPhone Simulator/5.0/Applications/

这篇关于Xcode- 删除的图像出现在模拟器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆