I have code that worked before iOS 4.3.5, now it doesn't work in iOS 5:
//Example of date I'm using: Mon, 31 Oct 2011 15:57:55 BRST NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"EEE, d MMM yyyy HH:mm:ss vvvv"]; [formatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]]; NSString *dateString = [TBXML textForElement:[TBXML childElementNamed:@"pubDate" parentElement:XML]]; NSDate *data = [formatter dateFromString:dateString]; [formatter release];
Now the data is going (null). Does anyone know what I did wrong?
Hello!
EDIT:
I searched the NSDateFormatter.h file and found:
init is commented out, so I'm not allowed to use [[NSDateFormatter alloc] init] correctly? Is there any other way to instantiate ah NSDateFormatter?
source share