ios益智应用程序崩溃后几轮 [英] ios puzzle app crashes after a few rounds

查看:172
本文介绍了ios益智应用程序崩溃后几轮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iPhone应用程序,似乎有内存泄漏的问题。这是一个益智游戏,经过几个谜题,应用程序崩溃的设备。

I have an iPhone app, that seems to have memory leaking problem. It's a puzzle game, after a few puzzles, the app crashes on devices.

我现在试图使用xcode仪器来检测发生了什么。第一次使用仪器。

I'm now trying to use xcode Instruments to detect what's going on. First time to use Instruments.

我注意到泄漏图中的泄漏栏,直到加载视图的时间:
这些内存泄漏对象是什么,由xCode检测仪器?
。但是这些泄漏的对象很小,所以我猜我的应用程序有其他问题。

I noticed a leak bar in the "Leaks" plot, right the time when the view is loaded: What are these memory leaking objects, detected by xCode Instruments? . However these leaked objects are small, so I guess my app has other problems.

当我的应用程序继续运行,通常在iPad 2上10多轮,然后崩溃。我对仪器不多,所以我看All Heap Allocations。在第一轮谜题的开始,#总体列是〜70k,它在谜题之间慢慢增长。

When my app continues to run, usually for 10+ rounds on an iPad 2, it then crashes. I don't much about Instruments yet, so I watch "All Heap Allocations". At the beginning of first round puzzle, the column "# Overall" is ~70k, it grows slowly between rounds of puzzles. When a new round puzzle comes in, it goes to ~90k, then round by round it reaches ~200k, then crashes.

在崩溃之前,在日志控制台中,我看到了一个新的圆谜题,当一个新的圆拼图进来时,它到〜90k,然后轮到它达到约200k,然后崩溃。内存警告和CONNECTION INTERRUPTED。

Before crashes, in the log console I see memory warning and "CONNECTION INTERRUPTED".

我在搜索内存泄漏后跟踪了一些事情,如将NSArray / NSDictionary或mutable设置为nil (虽然不是全部,因为有些人在谜题之间)。我也改变了UIImage imageNamed到[UIIMage alloc] initWithContentOfFile。

I've followed a few things after searching memory leaking, such set NSArray/NSDictionary or mutable ones to nil, as much as possible (although not all of them, since some go between puzzles). I also changed UIImage imageNamed to [UIIMage alloc] initWithContentOfFile.

我还要看什么/检查看什么导致内存问题? TIA!

What else should I look/check to see what causes memory problem? TIA!

编辑:
我希望我可以发布一些代码,可能是可疑的,但我真的不知道什么部分发布。我应该在课程开发中通过Instruments检查,以便我知道是什么导致了问题。

I wish I could post some codes that may be the suspect, but I really don't know what part to post. I should've check via Instruments in the course developing, so that I would know what caused the problem.

关于其他视图控制器。我有别人(菜单,设置,应用商店率等),我生成的所有的代码。我的应用程序没有故事板或nib文件。当我测试崩溃,我只需单击下一个谜按钮,因此所有其他视图将不会显示。所以,在崩溃之前,唯一的视图显示的是主视图,有几个按钮,几个子视图,一个动画图片(但只有第一个谜题作为介绍)。如果有帮助,这里是我的应用程序:
http://itunes.apple.com/us/app/wordsect/id599455449?ls=1&mt=8

Regarding other view controllers. I do have others (menu, settings, app-store-rate, etc) and I generated all of them via code. My app doesn't have a storyboard or nib file. When I test crashes, I just click Next Puzzle button, so all other views will not show at all. So, before crash, the only view shown is the main view, with a few button, a few subviews, an animated pictures (but only the first puzzle as introduction). If it helps, here is my app: http://itunes.apple.com/us/app/wordsect/id599455449?ls=1&mt=8

推荐答案

如果您尝试使用Instruments调试应用程序 - 启用僵尸检测模式:

If you trying to debug application with Instruments - enable zombie detection mode:


  1. Xcode:Product-> Scheme-> Edit Scheme

  2. 选择调试方案

  3. 在方案描述中选择Arguments / li>
  4. 在环境变量中添加并检查NSZombieEnabled变量

你会得到实例的名称,当你的应用程序崩溃。

Then when you start application under Instruments control, you'll get name of the instance, when your application crashed.

这篇关于ios益智应用程序崩溃后几轮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆