简体   繁体   English

iPhone应用程序在设备上崩溃

[英]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 infinite number of times. 它在应用程序上运行得非常好,我可以无限次更改图像。 But when I run it on my Ipod Touch, it crashes after the image changes about 4 times. 但是,当我在Ipod Touch上运行它时,图像更改约4次后崩溃。 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. 我应该提一下,每个图像都差不多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. 在设备(而不是模拟器)上运行时,也可以使用Instruments-> Leaks对其进行监视。

Check if you release object somewhere. 检查是否在某处释放对象。 It really looks like wrong use of release method. 确实看起来像错误地使用了release方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM