I have an NSArray with over 4.000 CGPoints
[NSArray arrayWithObjects:
[NSValue valueWithCGPoint:CGPointMake(213, 30)], ...
and want to draw the points or lines between them from inside my UIViewController. What is the best way for iOS devices?
thnx
Sounds like you’re trying to work with sprites or particle generation? Without knowing more details, I can only give a generic answer, but lemme give it a shot. Let’s assume the points are all simple 1-pixel coloured thingies. No gradients or paths required, just “set the pixel at x,y to red/green/blue.”
You should easily be able to manipulate 4,000
CALayerobjects simultaneously:Then, when it’s time to manipulate them, go into the array at
self.my4000SpritesPropertyand change the layers’ frames or other properties.For 4,000 elements, you should see acceptable performance with Core Animation.