如何向 NSDate 对象添加月份?
NSDate *someDate = [NSDate Date] + 30Days.....;
最佳答案
你需要使用NSDateComponents:
NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
[dateComponents setMonth:1];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDate *newDate = [calendar dateByAddingComponents:dateComponents toDate:originalDate options:0];
[dateComponents release]; // If ARC is not used, release the date components
https://stackoverflow.com/questions/8119880/