Convert string to date object

NSDateFormatter *dateFormatr = [[NSDateFormatter alloc] init];
[dateFormatr setDateFormat:@"YYYY MM dd"];
NSDate *date = [dateFormatr dateFromString:dateStr];
NSLog(@"%@",date);
Previous
Next Post »