views:

54

answers:

2

I have a simple app (this is my first one) which loads an image from my resources folder, I change my image like this (with the image name changing):

myUIImageView.image = [UIImage imageNamed:@"nextImage.jpg"]; 

It runs really well on the app I can change the image an infinite number of times. But when I run it on my Ipod Touch, it crashes after the image changes about 4 times. Do I need to release the image when I change it? It certainly seems to be a memory issue,

I should mention each image is like 200kb.

The console reads this when it crashes:

Program received signal:  “0”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")

Any advice would help, Thanks!

+1  A: 

When you say that it runs really well, do you mean it runs really well on the simulator?

I've found that its not good to check for memory problems on the simulator: it tends to be way too powerful compared to an actual device. The crash may not be on your image swapping code at all.

I recommend you go over your code and check for leaks. Also monitor it using Instruments->Leaks while running on the device, not on simulator.

Altealice
+1  A: 

Check if you release object somewhere. It really looks like wrong use of release method.

Sergei Lost