samedi 27 décembre 2014

iOS Convert NSString to NSDate alway nil

I'm trying to convert string to nsdate. The string date is "12/27/2014 07:42:00 AM +0000"


Here is my code:



NSDate *date =[[NSDate alloc] init];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"MM/dd/yyyy HH:mm:ss a";
date = [ dateFormatter dateFromString:dateString];


The date value is always nil. Any of you knows what canI be doing wrong?


I'll really appreaciate your help.




Aucun commentaire:

Enregistrer un commentaire