时间加减比较
- 作者: 用户48832393
- 来源: 51数据库
- 2022-08-17
NSDate *update = [[NSUserDefaults standardUserDefaults] objectForKey:APP_UPDATE_TIME]; CGFloat dayDifference; if (update) { dayDifference = [[NSDate date] timeIntervalSinceDate:update]/ 60.0/60.0/24.0; } if (!update || dayDifference > 2) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"更新提示V%@",systemVersionNo] message:config[@"releaseNotes"] delegate:self cancelButtonTitle:@"稍后升级" otherButtonTitles:@"立即更新", nil]; [alert show]; }
推荐阅读