I have this code
NSString *stringDate = @"2015-07-09 7:00 AM";
NSString *stringDateFormat = @"yyyy-MM-dd h:mm a";
NSTimeZone *timeZone = [NSTimeZone localTimeZone];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter setTimeZone:timeZone];
[dateFormatter setDateFormat:stringDateFormat];
NSDate *dateFormatted = [dateFormatter dateFromString:stringDate];
The problem now is dateFormatted keeps getting nil value. It is OK when I try it in Simulator iPhone5s 8.2 but, the problem occurs when I run it with device iPhone5s 8.3.
Can someone help me find why is dateFormatted is getting nil value?