How to efficiently show many Images? (iPhone programming)

后端 未结 4 1272
感动是毒
感动是毒 2020-12-16 03:18

In my application I needed something like a particle system so I did the following:

While the application initializes I load a UIImage

laserImage = [         


        
4条回答
  •  执笔经年
    2020-12-16 03:39

    Seems like you're trying to code a game by using the UIKit API, which is not really very suitable for this kind of purpose. You are expending the device's resources whenever you allocate a UIView, which incurs slowdowns because object creation is costly. You might be able to obtain the performance you want by dropping to CoreAnimation though, which is really good at drawing hundreds of images in a limited time frame, although it would still be much better if you used OpenGL or an engine like Cocos2d.

提交回复
热议问题