I store some dates in my NSMutableArray, I want to retrieve them and change the format. For the moment I do this:
NSDate *myDate = [self.dates objectAtIndex:0];
NSLog(@"myDate:%@", myDate); // 2010-03-02
NSDateFormatter *formatDate = [[NSDateFormatter alloc] init];
[formatDate setDateFormat:@"MMMM d YYYY"];
NSString *newDate = [formatDate stringFromDate:myDate];
NSLog(@"newDate: %@", newDate); // NULL
newDate的结果是NULL,我希望它变成像这样的东西:“2010年3月3日”。
谢谢 (xiè xiè)