Strict Date Parsing Gotcha (12 Hour Clock Example)

Be careful when parsing dates from strings. According to Technical Q&A QA1480, dates are parsed depending on a user’s
particular setup, e.g. locale viagra pas cher buy cheap viagra online from india. This happens even though the date format is specified strictly.
To ensure reliable parsing for all users, you need to explicitly set a NSDateFormatter’s locale property.

Example follows for a user that has their clock set to 12 hour:

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"HH";
// Prints "(null)"
NSLog(@"%@", [dateFormatter dateFromString:@"13"]);    
dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
// Prints "1970-01-01 12:00:00 PM +0000" on my device
NSLog(@"%@", [dateFormatter dateFromString:@"13"]);

Cisco E4200 v1 Airplay Network Bounce

Had a problem with my E4200 for a while, where if I attempted to use Airplay over 5Ghz Wi-Fi, the whole network would “reboot/bounce”. Finally came across a solution posted by canadamg over at the Apple discussion forums.

In router management, apply these settings:

Applications & Gaming -> QoS -> WMM -> ENABLE IT
Administration -> Management -> CTF -> DISABLE IT

I can confirm this works on my router with firmware version 1.0.03.


Xcode 4.3 Can’t Run OCUnit Tests

I was a bit frustrated when i upgraded to Xcode 4.3 and we started getting a SenTestCase symbol not found compiler error.

A very useful comment by “Daniel” gave me the solution:

The key is the Build Setting “Framework Search Paths”. It needs to contain the following values, in this order:


Thanks Daniel!