开发者

whats better, to insert multi images to uiimageviews using the code or IB?

开发者 https://www.devze.com 2022-12-13 18:04 出处:网络
if i have multi uiimageviews (30 images) in the view, is it better (for performance) to insert the images from the code or insert them u开发者_运维问答sing the IB.It\'s best you load so many images in

if i have multi uiimageviews (30 images) in the view, is it better (for performance) to insert the images from the code or insert them u开发者_运维问答sing the IB.


It's best you load so many images in code. This will allow you to load them lazily as-and-when needed.

In addition, try using CoreData to hold the UIImage objects as it is highly optimised and only wont pull data form disk until it's absolutely needed.


It won't be meaningfully different; most of the execution time will be loading the images themselves, rather than your code to create the image views in ObjC or through loading the nib.

So you should do what's better for your performance as a programmer; typically, if there's some kind of regular geometric pattern to the positions and names of the objects, code will be easier, but if not, IB will be easier.

0

精彩评论

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