根据本地时间判断程序是否运行,卡用户的时候使用
2017-04-13 本文已影响0人
iOS乐乐
NSString *currentTime = @"";
NSDate *date = [[NSDate alloc] init];
NSDateFormatter *df=[[NSDateFormatter alloc]init];
[df setDateFormat:@"yyyyMMdd"];
currentTime = [df stringFromDate:date];
if ([currentTime intValue] > 20161030) {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"版本已过期" message:@"测试版本时间已过期,请联系开发人员" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
[alert show];
return NO;
}