开发者

Can I lazy-load my libraries so they don't delay my app startup?

My app takes a long period of time during the startup, while the splas开发者_运维知识库h screen is shown. I assume that It is so due to the size of what the iOS has to load, including libraries. My question is, can I load those in the moment the user actually wants to use it, so it makes the startup time shorter? Are there other ways to do it shorter? Thanks a lot.


All 3rd party libraries are statically linked to your app. In theory you can lazy load only Apple's own weakly bound libraries. I am not aware how you can control this process on iOS. It's certainly possible on Mac.


sure you can as long as you don't need them directly.

LazyLoad is not limited to what you apply it too, for example if you have a huge Opengl scene you can chose not to laod its textures until the user actually click on the button you need.

The downside of this is that the waiting time to open whatever requires a lazyload will be moved further down the app (when the user wanted to play he will have a longer loading time).

What you could try is to launch Thread that handles the loading at startup and from the thread you do a setBooleanLibXFinishedLoading this way your app will only have to wait for all the booelan to be set to proceed. This should reduce the apparent waiting time for the user while optimizing the time actually spend loading.

hope this helps

Jason

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜