or azran or azran - 1 year ago 87
iOS Question

How to add one month to an NSDate?

How To Add Month To NSDate Object?

NSDate *someDate = [NSDate Date] + 30Days.....;

Answer Source

You need to use 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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download