Archive for June 2012

Google I/O day 1

Well day 1 of Google I/O is in the rear view mirror. While the event logistics were not the best, the content was decent, if a bit geared toward the intermediate to advanced Android developer. The line to get my Android developer devices was far too long, so I decided to wait until the next day.

After the conference was done for the day, I decided to take public transit and head over to Amoeba Music in Haight-Ashbury, and I was a bit diasppointed. I had not been there in many years, and I guess I remember it having more selection before. But I could be wrong.

BTW, happy Perfect Number Day to everyone out there. Yeah, that is not an actual holiday, I just made it up.

Locale friendly numeric entries

If you are ever planning to have someone from a country other than the U.S. use your iOS application, then I would go through right now and check for all the floatValue and doubleValue methods of NSString, and get rid of them if the NSString is coming from data that the user can enter. Needless to say, those users in Europe who use a comma for the decimal separator and a period for the thousands separator will notice some hilarities when using your app.

I put together a quick method in my NSString categories code (notice that it uses self as the source string) that I am using to avoid this very issue. Here is what it looks like:

- (double)localeSafeDecimalValue
    NSNumberFormatter *decimalStyle = [[NSNumberFormatter alloc] init];
    [decimalStyle setNumberStyle:NSNumberFormatterDecimalStyle];
    NSNumber *n = [decimalStyle numberFromString:self];
    [decimalStyle release];
    return [n doubleValue];

This will work as long as the user is entering numbers in the format that their International Settings are set to on their iOS device.

BTW, happy birthday to Michael Anthony, bass player and backup singer of Van Halen and Chickenfoot fame.

Open Source iOS Projects (Codestock, June 15, 2012)

Thanks to everyone who turned out first thing on Friday morning for my presentation on utilizing open source iOS projects. This was the second time I gave this presentation, and this time it went a bit better, as I was not constantly switching back and forth between the slides and Xcode.

If you would like to download a PDF of the presentation, here is a link:

Open Source iOS Projects presentation v2

Also, if you would like to download a ZIP file of all of the demos that I did, here is a link for that:

Open Source iOS Projects demos v2

BTW, happy enactment day to the Smoot-Hawley Tariff Act, enacted this day in 1930. Those “Save Ferris” fans out there should remember this piece of legislation well.