问题
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