我正在使用以下代码将日期从 NSString 转换为 NSDate
NSString *dateString = @"julho-29-2012 05:01 PM";
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"dd-MM-yyyy hh:mm:ss a"];
NSDate* dateFromString = [dateFormatter dateFromString:dateString];
NSLog(@"%@",dateFromString);
[dateFormatter release];
但这对我不起作用:(