I have issues with date parsing. It works on my devices and simulator, but not on client device (which is also iPhone iOS 5.1.1, but maybe a different configuration)
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
NSDate *date = nil;
NSError *error = nil;
[formatter setDateFormat:@"EEE, dd MMM y HH:mm:ss zzz"];
if (![formatter getObjectValue:&date forString:@"Mon, 21 Jun 2012 21:21:21 GMT" range:nil error:&error])
{
NSLog(@"%@", error);
}
which outputs
Error Domain=NSCocoaErrorDomain Code=2048 "The operation couldn’t be completed. (Cocoa error 2048.)" UserInfo=0x446f10 {NSInvalidValue=Mon, 21 Jun 2012 21:21:21 GMT}
You need to set the locale on the date formatter to
en_US_POSIX.