Posts

Showing posts with the label xcode

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...

Using Workspace in XCode 4

Workspace in XCode 1) Create new Workspace (refer as WS) 2) Configure Workspace Settings File > "Workspace Settings" > Build tab > Advance > Build Location > Derived Data Location 3) Add project to WS (refer as P), make sure it runs. 4) Configurating (P) "PROJECT > Build Settings" > "Search Paths" > "Always Search User Paths" = "Yes" > "User Header Search Paths" = "../(libraryFolderName)/(libraryFolderName)" OR > "Header Search Path" = "../(libraryFolderName)/(libraryFolderName)" > "Linking" > "Other Linker Flags" = "-ObjC" 5) Add library project to WS (refer as L), by right clicking on empty space in the "Project Navigator" (Optional) Make sure library project "TARGET > Build Settings > Deployment > Skip Install" = "Yes" (Optional)  If you plan test s...

Import Private Key to KeyChain

Importing Private key to the Keychains sometimes throws an error, but if we use the security  to import via Terminal, there is no erro at all. Its probably a bug with the Keychains App. To import Private Key to key to Keychains using Terminal, type the following in the Terminal, where the *.p12 file is the private key and *.pem file is the cert, login.keychain refer to the the current login user's keychains store. security import PushFeedKey.p12 -k ~/Library/Keychains/login.keychain security import PushFeedCert.pem -k ~/Library/Keychains/login.keychain security import DeveloperKey.p12 -k ~/Library/Keychains/login.keychain security import DeveloperCert.pem -k ~/Library/Keychains/login.keychain