Question

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?

Était-ce utile?

La solution

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

Autres conseils

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.

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"

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top