我知道有很多关于这个问题的答案,但我需要有人能解释我很容易,为什么SDK 3.1.3代码波纹管返回正确的结果,而在IOS4中的相同代码返回nil。 非常感谢您的任何建议。
马塞罗IOS4 NSDateformatter回报为零,前3.1.3确定
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *testOut = [dateFormatter dateFromString:[itemAtIndex objectForKey:@"data"]];
NSDateFormatter *df = [[NSDateFormatter alloc] init];
df.dateStyle = NSDateFormatterShortStyle;
NSString *pippo = [NSString stringWithFormat:@"%@ >",[df stringFromDate:testOut]];
2010年5月6日
嗨, 我试图按照您的信息,使用此代码解决:
NSString *myDate = [NSDateFormatter localizedStringFromDate:[itemAtIndex objectForKey:@"data"] dateStyle:NSDateFormatterMediumStyle timeStyle:NSDateFormatterShortStyle NS_AVAILABLE(10_6, 4_0)];
,但我只得到无效CFStringRef ...
它只是一点点沮丧 你有任何建议.. 感谢您的时间.. Marcello