沒有人知道爲什麼我通過我的日期格式化程序後得到空日期值?日期格式化程序後獲得空值
//Sets expire date for listing to String
NSString *expireDate = [[_itemDetailArray valueForKey:@"expireDate"]description]; //returns my date correctly
NSString *formattedStringDate = [NSString stringWithFormat:@"%@",[formatter dateFromString:expireDate]]; //comes out null
任何想法爲什麼?
你是如何初始化格式化程序的? – AlexWien
NSDateFormatter * formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@「MM-dd-yyyy」]; [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:-28800]]; – mreynol
什麼包含過期日期? – AlexWien