Yes, agreed with @Jan Gressmann, this is so wierd! I am using the NSDateFormatter on non-ui thread as well, and dateFromString selector returns null sometimes... For example, I have this code:
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
[dateFormat setLocale:usLocale];
[dateFormat setDateFormat:@"dd MMM yy HH:mm:ss"];
NSDate *startDate = [dateFormat dateFromString:str_StartDate];
NSDate *endDate = [dateFormat dateFromString:str_endDate];
Output in console:
(lldb) po str_StartDate
(NSString *) $7 = 0x06da2180 03 SEP 2012 10:00:00
(lldb) po str_endDate
(NSString *) $8 = 0x06d3a810 08 SEP 2013 10:00:00
(lldb) po startDate
(NSDate *) $9 = 0x00000000 <nil>
(lldb) po endDate
(NSDate *) $10 = 0x06db05b0 2013-09-08 02:00:00 +0000
This is really wierd...