开发者

iPhone: Is my app crashing because of no memory, or over-release, or something else?

I'm using my app and when I use it for the beginning of the day, everythi开发者_运维百科ng works fine. However, as I gradually test it and repeat certain tasks over and over, as the day goes on, my app just crashes. Specifically, views start disappearing in my current screen, and when I go back, the view is missing labels, images, etc. Then all of a sudden, it just goes BLACK, and doesn't really crash, but just remains black, and dysfunctional.

I checked the crash log, and it's very cryptic. I just see " failed to resume in time", everything else in the log doesn't give me much meaningful information.

I know anything could've caused this, but what probably caused it? Was it:

1) Using too much memory, and views probably got unloaded in viewDidUnload? 2) Due to an over release of an object? 3) Accessing an invalid pointer or something?


You are likely gradually running lower and lower on memory, forcing these views to begin unloading. iPhone apps are designed to try to survive this way, by dumping unused views first. Once things get to a certain point though, the app will be essentially unusable.

I'd check your app with the leaks instrument and make sure you're releasing things properly.


"Failed to resume on time" can also be due to having built up larger and larger data structures that maybe don't take too much storage, but take a long time to traverse when something occurs in the app. The most obvious would be a navigation controller with lots of screens stacked in it, but there could be other app-specific data structures involved.

We had one app that did this because it needed to "walk" a large (and nearly circular) data structure to build a screen in viewWillAppear.

But in combination with the disappearing data it sounds like you have a storage problem. Or perhaps two separate problems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜