Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make Xcode refresh its local copies of my project's image files?

Tags:

xcode

iphone

I'm having some weird issues with Xcode, and this is pretty much impossible to find answers by simply googling around.

I have a few icon image files (just PNGs) in my Xcode project, and when I modify some of them in Photoshop, they don't get updated when I do another build in Xcode. In order to fix this I have to re-add the file again to the project, and then remove the old version of the file that is already in there in Xcode.

What am I doing wrong here? I'm updating/replacing the image file that is stored in my project's directory directly from Photoshop, so I assumed that it would just get reloaded and the new version would show up.

UPDATE: Looks like what happened was that when I first imported the image files into my project, they got added to my "Classes/" sub-directory. So when I was updating them, it was just adding them to the root of my project.

like image 254
jpm Avatar asked Dec 31 '08 18:12

jpm


2 Answers

I had the exact same problem. The following fixed it for me: In Xcode, go to Project --> Clean

This will purge the old images from xcode cache and will show your new image

like image 55
vedran Avatar answered Oct 02 '22 02:10

vedran


That's pretty weird. I'd suggest two things:

  1. Check that you're not saving your photoshop files into the wrong directory. I know this seems straightforward but its worth a check. Make sure you're not saving them into the build/ directory or anything like that.

  2. Before running again in the simulator, try cleaning all build targets first to ensure that your project actually builds again before launching the simulator.

like image 29
sammich Avatar answered Oct 02 '22 02:10

sammich