Posts

Showing posts with the label instrument

ObjC Optimization Tips

Image
Over the past few weeks, I've been focus on doing performance tuning on a iPad app.  A little background of the app It is an business app, doing financial investment. It has lots of moving parts on the GUI, user can drag, slide and flipping, a graph, and lots of numbers and dates. User can play around with different combination of input and see their investment prediction over few years. There were around 50 parameters (or more) that affects actual calculation result. The app has at least 8000 lines of codes just for doing calculation.  The story The Product Owner has been complaining to the team that the app has a serious performance issue. It's sluggish and the financial result does not reflect user's interaction immediately (PO generally don't care how complicate you back-end is). The financial graphs took ~5 seconds to redraw on screen, when user is moving the slider, and they are moving it continuously back and forth. Tools I uses for this task. ...

Debugging a freaking EXC BAD ACCESS in iOS App

Image
One of the exception that I often run into in any iOS app development is the freaking EXC BAD ACCESS . An error which is occurs due to error in memory management, e.g. accessing an object that has been release or passing an invalid pointer to a system call (delegate call).   Enough saying, so how do you trace it down and find the object that you are trying to access and cause that exception? Well there is 2 ways: NSZombie which is mentioned in Apple developer library's Memory Management guide Instrument tools to profile your app. See this article for details on this tools. To use NSZombie class you simple add  NSZombieEnabled  into your project Environment Variable . You can access the  Environment Variable settings screen by clicking  Product > Edit Scheme from the menu.  Expand Environment Variables section and click on the + icon. Add NSZombieEnabled into the field. (you can also add  NSAutoreleaseFreedObjectC...