how can I add one minutes in current NSDate of iphone and save in NSDate?

前端 未结 2 896
长情又很酷
长情又很酷 2021-01-17 11:15

I can get current date of iphone via this code as

NSDate *currentDate = [NSDate date];
NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init];
[da         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-17 11:52

    Or even shorter:

    Objective-C

    //60 seconds
    [NSDate dateWithTimeIntervalSinceNow:60];
    

    Swift

    //60 seconds
    NSDate(timeIntervalSinceNow: 60)
    

提交回复
热议问题