Go to Pay4Bugs.com

The Pay4Bugs Blog

Pay4Bugs is the original pay per bug software testing marketplace. Our testers seek out and report problems with your software or website before they cause you to lose sales and customers.

Making sure your iPhone App works with different Region Formats

Posted by C.S. Hsia on · Comments

To many Apple products and software are the symbol of perfection..... until you start developing for iOS and realize that not all is as elegant as you imagine it would be.

2 weeks ago I presented the infamous Apple iPod Touch 1970 bug, showing how devices shipping with a 1970 time, and without connectivity to synchronize the time can wrack havoc with some iOS applications. Ironically, I've discovered a problem from the complete opposite side of the spectrum.

We were receiving many bug reports from European and South American users. These seem to occur exclusively to iPhones, and none of the reports came from The United States or Asian countries. Where the iPod touch bugs were cased by the lack of connectivity and time synchronization, it seems that iPhones and iPads with cellular connectivity was causing XML data to not function properly.

As it turns out, the iOS aggressively changes your phone's Regional Format based on the signals of your local cellular carrier. Customers who had no problems with the app in the United States could not receive data as soon as the plane landed in Budapest. Even switching to Wifi did not resolve the issue, since the settings have already been modified.

To overcome this issue, make sure to explicitly use a certain Regional Format for your app, by specifying it in the source code.

+  [f setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];

For those programming with lots of network based XML data, and anticipate users from around the world, add this as part of your disciplined programming practice. I never expected Apple to make iOS behave  this "proactively" in changing the phone's Regional Formatting, and unfortunately suffered some consequences.

This also leaves me thinking.... what else is Apple changing when my phone hops onto a different carrier? Code with care.