1

I use a loop to load images into an NSMutableArray. Each iteration loads an images using the imagedNamed function in UIImage: [UIImage imageNamed:*name*];.

However, I wanted to change some of the images. So I removed the images from the project and added the new ones. But when I run the app in the iOS-simulator, the old images appear. Even when I remove all images from the project, they still appear.

Can someone explain why this is happening, and how I can change it?

pb2q
  • 58,613
  • 19
  • 146
  • 147
Mark
  • 1,258
  • 13
  • 25
  • 1
    Reset the simulator, clean the build.. If nothing works, check image name to see they match with the ones you deleted.. Last, quit and reopen xcode.. – Krishnabhadra Jun 18 '12 at 10:26
  • The cache (and therefor old/wrong images) persisted even after I went to Settings > General > Reset > Erase All Content and Settings. – owenfi Sep 09 '12 at 20:32

4 Answers4

5

The problem is that XCode hasn't recognised the new resources and usually the only way to fix it is to delete the old resources from the build folder.

Cmd + Opt + Shift + K cleans all targets and the build folder. This should fix it

James Webster
  • 31,873
  • 11
  • 70
  • 114
  • Thanks, this worked better than Build > Clean (and if you hold option down you see the "Clean Build Folder..."). – owenfi Sep 09 '12 at 20:34
2

Clean your project CMD + SHIFT + K (XCODE 4.3 and above). sometimes reference of deleted items remains in the project and make sure that u reset your simulator also.

Deepak
  • 348
  • 4
  • 14
1

Did you clean your project in XCode ? Sometimes when you change some resources like images, XCode doesn't copy the new ones one the simulator / device.

To do so, go to "Product" -> "Clean"

Zoleas
  • 4,869
  • 1
  • 21
  • 33
0

delete app from simulator, clean project and make sure that image exist. Image name is case sensitive. It may see on simulator but on device image will not display

gauravds
  • 2,931
  • 2
  • 28
  • 45