iPhone application crash on launch

南笙酒味 提交于 2019-12-04 08:36:44

You are still blocking the main thread too long - be it during launch or later. Only do lightweight GUI work on the main thread. The main thread is also blocked if you perform work on a second thread but wait in your main thread for the results.

Instruments is your friend here.

seems everything is performing on the main thread... (am I right?) If this is the case it may stuck your UI. Did you consider to load your database information on another thread and update your GUI as you get the data? second, you can measure the performance of each chunk of code in time-cosuming relation and see what exactly takes it so much time to load.

its setting off a watchdog timer. its blocking the main thread for more than 20 seconds. as has been said, you need to lazy load. only load up something that will be visible on the first screen.

run some time profiles on it using instruments, try and fix anything that is particularly inefficient and try to kick as much as you can get away with onto a background thread.(IE anything that is not going to be updating the UI) you can load lots of data on a background thread, and once the data objects have been set up pass them back to the main thread, and run an update selector from there.

Although I don't have direct experience with this, after reading your crash log, it appears that the device noticed your app taking 100% CPU time for slightly longer than 20 seconds after launch. It would appear that even though this CPU usage isn't inside the applicationDidFinishLaunching: method, the operating system isn't fooled and terminates your app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!