NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease];
[dateFormatter setDateFormat:@"EEE, d MMM yyyy HH:mm:ss zzz"];
NSString *dateString = @"Tue, 08 Jun 2010 17:00:00 EDT";
NSDate *eventDate = [dateFormatter dateFromString:dateString];
Run Code Online (Sandbox Code Playgroud)
在这种情况下,eventDate对象为nil.有人能告诉我吗?这段代码以前有用.
更新:无法谈论为什么由于NDA而无效.我只想说,当iOS 4出局时,我会将答案发给我自己的问题.