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;
}
网友评论