IPhone App Crashes on Device
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 infini开发者_开发知识库te 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!
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.
Check if you release object somewhere. It really looks like wrong use of release method.
精彩评论