I am having a date format "16-11-2011". but I want to convert it into "16 Nov" I written the code for it but null value generates instead of the format "16 Nov"
我已写了以下法典:
NSDate *checkIn = [[NSUserDefaults standardUserDefaults]valueForKey:@"CHECK_1"];
NSLog(@"Date: %@",checkIn);
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"dd MMM"];
NSString *checkInDate = [formatter stringFromDate:checkIn];
NSLog(@"checkInDate:%@",checkInDate);
ns statements
Date: 16-11-2011
checkInDate:(null)
因此,我无法将其转化为我想要采用的形式。
plz帮助我解决问题。