iOS应用启动时间过长,无法显示 [英] iOS app launch takes too long to display

查看:267
本文介绍了iOS应用启动时间过长,无法显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在使用第一个应用程序,已完成大部分编程工作,但应用程序启动时花费的时间太长,无法在标签栏上显示第一个表格视图.启动需要8到10秒钟才能显示.寻找有关跟踪所需时间的代码的帮助,等等.这是常规的应用程序设置:具有5个选项卡的选项卡栏,包括导航栏,带有详细视图的表格视图和滚动视图. tableviews的数据来自远程Web服务器的多个json feed.在appdelegate.m中,我正在设置完整的标签/导航栏.我在选项卡栏上设置的每个单独的视图控制器中获取json数据供稿.我使用了探查器,但不知道我在寻找什么以及在哪里.启动时会加载什么?有关可能会导致延迟的应用程序常规设置的任何建议?是否加载选项卡栏上所有关联的视图?在此先感谢您的帮助.

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.

推荐答案

通过工具运行程序.总是.每时每刻.它将告诉您大多数问题.

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

也就是说,您可能需要将启动任务委托给后台线程,并在数据可用时更新UI.

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

使用NSOperation,GCD和相关技术来执行后台任务.

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

这篇关于iOS应用启动时间过长,无法显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆