Skip to content

November 8, 2009


PM Me Your AM

by shiftyjelly

We just released v2.0.1 of Pocket Weather AU and v1.0.2 of Pocket Weather World to Apple. Exciting isn’t it! Well not really, as the minor number increments betray, they are both bug fix releases. In this case it’s a bizarre bug that took a little while to get to the bottom of. If you’re not technically minded, then feel free to go browse digg or something instead, here goes:

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyyMMddHHmmss"];

So what the above code is meant to do (once you give it a date) is to give it back to you in the format you asked for it. That’s what the doco says, and that’s what 99 times out of 100 it does. So a typical result might look like ‘20091108123301’ (for today). On some iPhones (and we have no idea what causes this) you get ‘20091108123301 PM‘. Yeah that’s right, you get ‘PM’ or ‘AM’ at the end even though you didn’t ask for it. This only happens to iPhones that are set to AM/PM time, but most of them behave, like we said it seems to be very rare indeed that you get this outcome.

Anyway the workaround for our users is to set their iPhone to 24 hour time. The code workaround is to do the following:

[dateFormatter setAMSymbol:@""];
[dateFormatter setPMSymbol:@""];

We’re just glad we got to the bottom of this diabolical bug, so we can get back to adding new features and tweaking existing ones 🙂

Read more from Uncategorized
1 Comment Post a comment
  1. awnm
    Nov 16 2009

    Enjoying v2 very much – thanks for a great app. One suggestion (for the tweaking) is to add the, er, long summary for the next day when it becomes available.

    For example, at 4:18PM 16 Nov for PW currently lists the Sydney Observatory Hill precis for 17 Nov as “Becoming fine”, but the BOM site has the updated text of “Chance of an early shower or two, then fine. Sunny periods. Fresh to strong southerly winds, easing later in the day.”, followed by the precis PW is showing.

    Be nice to get that more detailed update for the next day displayed in PW when the BOM make it available.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments