iOS app launch takes too long to display

大憨熊 提交于 2019-12-25 04:58:38

问题


Working on first app, have most of the programming done but app is taking too long at launch to display first tableview on tabbar. It takes 8-10 seconds on launch to display. Looking for help on tracking down what code is taking so long, etc. Here is the general app setup: tabbar with 5 tabs including navigation bars, mix of tableviews with detail views and scrollviews. The data for the tableviews is from multiple json feed from a remote web server. In the appdelegate.m I'm setting up the full tab/navigation bars. I get the json data feeds in each individual view controllers that setup on the tabbar. I've used the Profiler but don't know what I'm looking for and where. What is loaded on launch? Any advice on general setup of app that could be causing the delay? Does it load all views associated on the tabbar? Thanks in advance for any help.


回答1:


Run your program through instruments. Always. All the time. It will tell you most of the problems.

That said, you probably need to delegate your startup tasks to background threads, and update the UI as data comes available.

Use NSOperation, GCD, and related technologies for executing your background tasks.



来源:https://stackoverflow.com/questions/11496047/ios-app-launch-takes-too-long-to-display

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