根据本地时间判断程序是否运行,卡用户的时候使用

    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;
    }

你可能感兴趣的:(根据本地时间判断程序是否运行,卡用户的时候使用)