Tutorial :Drawing on a view(in a scroll-view) is consuming too much memory in ipad devices


I have a view added on a scrollview(maxZoomScale = 1, minZoomScale=0.25). view-frame have a size of near-about(2000, 2000). I have written code for drawing a path(for ~8000 points) in the drawRect of the view. Whenever scrollview's zooming ends, i flagged the view's drawing. Now each time drawRect is called it consumes huge memory (~16MB). Due to this iPad reboots giving memory warnings. Please any body help me to solve out this issue...


Investigate CATileLayer. You should not be drawing a 2000x2000 view; most of the stuff there is offscreen.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »