2012-10-12 19:29:43
Aquivalent NSDateFormatter:
[_dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
Throws an exception … Why?
Thank you!
Reference: http://waracle.net/mobile/iphone-nsdateformatter-date-formatting-table/
UPDATE:
The problem seems to be the string. If I hardcode the string:
NSString * string = @"2012-10-12 19:29:43";
It works fine.
I read it from an array of key-value pairs so I do:
NSString * string = [NSString stringWithFormat:@"%@", (NSString *)[[NSArray readFromPlistFile:@"latestchangesdates"] valueForKey:@"newsLastEdited"]];
Console Output:
#1:
2012-10-12 10:16:49
#2:
( "2012-10-12 10:16:49" )
I think the problem is something which has to do with the string parse from the array.
UPDATE 2:
[[[NSArray readFromPlistFile:@"latestchangesdates"] objectAtIndex:0] valueForKey:@"newsLastEdited"]]
… finally did it.
… finally did it.