简体   繁体   English

奇怪的iOS导航应用崩溃

[英]Strange iOS navigation app crash

I'm writing a navigation app for iPhone at the moment and I'm having a very weird crash issue and was wondering if anyone had come across (and solved) this issue. 目前,我正在为iPhone开发一个导航应用程序,遇到一个非常奇怪的崩溃问题,想知道是否有人遇到(并解决了)这个问题。

I have two views, both of which contain UITableViews and one that uses cells loaded from a nib. 我有两个视图,两个视图都包含UITableViews,一个视图使用从笔尖加载的单元格。 When I push and pop from one view to the other, after a couple of presses (usually 7 to 10) with everything loading and displaying as it should the app suddenly crashes. 当我从一个视图推入另一个视图并弹出时,经过两次按下(通常是7到10次),所有内容都加载并显示,因为应用程序突然崩溃了。 The debugger shows that CALayer was the last thing running, but I don't use any custom implementation of this class. 调试器显示CALayer是最后运行的东西,但是我没有使用此类的任何自定义实现。

My first thought is that I've over-released an object, but after two days of playing with the code I can't identify any zombies. 我的第一个想法是我已经释放了一个对象,但是在玩了两天的代码之后,我无法识别任何僵尸。

Does anyone know what's going on here? 有人知道这是怎么回事吗? Can post parts of code if required. 如果需要,可以发布部分代码。

UPDATE: Looks like zombies are being created on UIView delegate methods, namely viewWillAppear, viewDidAppear, viewWillDisappear, viewDidDisappear. 更新:似乎在UIView委托方法(即viewWillAppear,viewDidAppear,viewWillDisappear,viewDidDisappear)上创建了僵尸。 Will investigate further tomorrow. 明天将进一步调查。 :D :D

What you can do is to set breakpoints at the dealloc methods of the related classes, and see if the crash happens in one of the method. 您可以做的是在相关类的dealloc方法上设置断点,然后查看崩溃是否发生在其中一种方法上。 And also usually by looking at the callstack when the crash is happening, you can tell whether it's a memory related crash or not. 而且通常也可以通过查看崩溃发生时的调用堆栈来判断它是否是与内存相关的崩溃。

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

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