One thing I understood clearly using ARC, is memory management. Strange, I admit, because this never happen to me back in retain/release old school method. But in some way this semi-auto-powerfull-Icountforyousoyoudon’thaveto technology helped me to use more and more often Instruments to watch for object Allocations.
In this new project I’m working, I’m using Cocos2D, because I need to build an OpenGlES app with a parallax scroll with multiple layers and of course, to add more complexity, all the data comes from a preload DB with, let’s say (for now), 7000 inserts. Drawing 7000 icons that scroll is just non sense and its just out of a question, so I came out with the same old mechanism “draw only what you need”.
It took me a few days (I admit, my math isn’t soo strong, it was, when I was doing Flash, then I moved into regular apps with UI and UX) but at the end I solved quite elegantly with just a small method. Now I check for every movement of the camera, what icons should be inside that area and what is outside. Simply removing all the sprites and drawing only the ones I need, which soo far I only need 12 every time. Memory consumption max 2.4mb and OpenGLES performance at 60fps. I think I can be happy with my coding. I like to be a maniac perfectionist ^_^ (also a never changed geek and nerd)
tune of the day
Cerrone - Supernature