Je reçois la valeur null lorsque j'imprime le journal pour sourceDate. il donnera une valeur NULL.Renvoie la valeur NULL
Le code est:
NSMutableString * orignalStr = [[NSMutableString alloc] init];
[orignalStr appendString:date];
[orignalStr replaceOccurrencesOfString:@"T"
withString:@" "
options:NSCaseInsensitiveSearch
range:NSMakeRange(0, 15)];
NSLog(@"The orignalString is =%@ ",orignalStr);
NSDateFormatter* dateFormatter=[[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss zzz "];
NSDate *sourceDate =[dateFormatter dateFromString:orignalStr];
NSLog(@"The sourceDate is =%@ ",sourceDate);
plz help me ...
Que signifie la sortie de journal pour 'originalString'? –
Le journal devrait être comme ça .. 2011-07-21 12: 25: 38.814 GameTimeBaseBall [1270: 207] Le orignalString est = 2011-07-19 19 GMT: 10: 00 2011-07-21 12:25: 38.815 GameTimeBaseBall [1270: 207] La dateFormatter est = 2011-07-21 12: 25: 38.815 GameTimeBaseBall [1270: 207] La sourceDate est = (null) –
Non je ne reçois pas –