ios - 加载xib慢的问题
PHP中文网
PHP中文网 2017-04-17 17:20:09
0
2
318

经常遇到present 一个Xib生成的viewController的时候很慢的问题。

一半第一次点的时候没反应,点第二次的时候才出来。。或者第一次点等1秒钟之后才出来,是xib的问题么?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
巴扎黑

How much content does your xib file have? What is the test model?

Added:

You are talking about the startup waiting time, which is the time from opening the APP to the time your login page is displayed. This is normal. The startup time in Debug mode is about 50% slower than the Release version finally submitted to the App Store. At the same time, the intervention of various debugging tools of xcode will affect the startup time. Therefore, many other apps you download can be opened in seconds, but your own Debug version cannot be so fast.

The second point is the mutual reference of header files. For example, xocde7.0 removes the pch file from the project by default. This file served as a public header file in previous projects. But this can easily cause cross-references in header files, resulting in slower compilation (I don’t know if it will affect startup speed

The third point is to try not to do CPU-intensive operations in the class methods +load and +initialize, which will cause startup lag

Finally, my experience is that although xib is slightly slower than pure code, it will never be stuck, or the slow loading can be noticed by the naked eye.

迷茫

xib just serializes the view information, and there is no difference in the final running speed

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!