Preparing my application for iOS4
Since iOS4 came out, I had a chance to try out Ultimate Password Manager on my 3GS and see how things were going. Well, Things did not go as expected. The application was crashing at launch, 2 or 3 seconds after startup to be exact. This was telling me that the application initialization sequence was going pretty far before encountering a problem. This was the time to fire up Xcode 3.2.3 and try a quick Build and Run. Here is what was in need of attention in order to be fixed.
Interface Builder - XIB warning and errors
The easiest part was the Interface Builder seems a little bit more capricious regarding segmented controls:
Objective-C runtime errors
It seems that the Objective-C runtime under iOS is more strict regarding the usage of integer stored in an NSDictionary as NSNumber... In order to read them back, if they were stored in NSNumber, they need to be read with objectForKey:, followed by a integerValue message sent to the NSNumber object. Here is an example:
The following line in iOS 3.1.3 would return an integer without any issue but crashes in iOS4:
The fix was to rewrite this as:
Lost of small fix had to be applied in many places...
Multitasking - fast switching
My application was not ready to support iOS4's fast application switching. Having the application sitting in the task switching bar in a "suspended" stated for a long time without receiving any event to quit was creating a problem: if the user selected to "kill" the application from the task switcher, it would lose all of the application's data modifications. For a quick fix, I had to use the new UIKit key: UIApplicationExitsOnSuspend set to True in the info.plist. This way, when the user switches to another tasks, Ultimate Password Manager is really quitting and saving its data as on iOS 3.1.3. In a future version of my application, I will make sure that fast application switching is fully supported by responding to the right delegate method sent to the UIApplication object.
Version 2.2.1 of Ultimate Password Manager that fixes of those problems has been submitted to Apple for approval. I'm still waiting for them to let it go. My users upgrading their device to iOS4 are complaining. Not good. The waiting game is in full swing.
1 Comment | 




Reader Comments (1)
We are involved in the mobile development industry, specialising in developing apps for the iPhone, iPad, Android and Blackberry. For more information, please look at our link: http://bit.ly/cMasiI