我想使用以下代码从生日数组中恢复天数
for(int i =0;i<_convertedBdates.count;i++){
NSDateFormatter *tempFormatter = [[NSDateFormatter alloc]init];
[tempFormatter setDateFormat:@"dd/MM/YYYY"];
NSDate *firstdate = [tempFormatter dateFromString:[_convertedBdates objectAtIndex:i]];
NSString *curYear = [tempFormatter stringFromDate:[NSDate date]];
NSDate *secondDate = [tempFormatter dateFromString:curYear];
NSTimeInterval lastDiff = [firstdate timeIntervalSinceNow];
NSTimeInterval todaysDiff = [secondDate timeIntervalSinceNow];
NSTimeInterval dateDiff = lastDiff - todaysDiff;
int day = dateDiff/(3600*24);
NSLog(@" _newlymadeArray %@",[_convertedBdates objectAtIndex:i]);
NSLog(@" days %d",day);
[_daysremaining addObject:[NSString stringWithFormat:@"%d",day] ];
}
NSLog(@" days %@",_daysremaining);
我做错了什么为什么我没有得到正确的日子