Adding a day to current date in iOS

前端 未结 6 1668
孤城傲影
孤城傲影 2021-01-02 11:03

I saw this post: iOS and finding Tomorrow.

The code provided is:

units = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
NSDateComponen         


        
6条回答
  •  南方客
    南方客 (楼主)
    2021-01-02 11:54

    Simple and straight forward solution :

    NSDate *currentDate = [NSDate date];
    
    NSDate *nextDate = [currentDate dateByAddingTimeInterval:(24*3600)]; 
    

    This is working fine for me.

提交回复
热议问题