请输入正确的身份证号

- (void)uploadUseridCard:(NSString *)idCard

{

NSLog(@"IsIdentityCard:%@",![idCard CheckIsIdentityCard:idCard]? @"YES":@"NO");

if(![idCard CheckIsIdentityCard:idCard])

{

UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"请输入正确的身份证号\n由字母或数字组成(15位或18位)" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil];

[alertView show];

}

else

{

if (idCard.length == 0) {

dispatch_async(dispatch_get_main_queue(), ^{

[MTCustomAlertView showCustomAlertViewWithContent:@"身份证号不能为空" andRect:KTOASTRECT andTime:3.0f andObject:self];

});

} else if (!(idCard.length ==15||idCard.length ==18)) {

dispatch_async(dispatch_get_main_queue(), ^{

[MTCustomAlertView showCustomAlertViewWithContent:@"请输入15或18位正确身份证号" andRect:KTOASTRECT andTime:3.0f andObject:self];

});

} else {

if ([MTUnit allSpace:idCard]) {

dispatch_async(dispatch_get_main_queue(), ^{

[MTCustomAlertView showCustomAlertViewWithContent:@"不能输入空格" andRect:KTOASTRECT andTime:3.0f andObject:self];

});

} else {

_idCard = idCard;

[self.displayTableview reloadData];

NSDictionary *params = @{

@"userId"  : [WMUserDataManager readPassWord],

@"idCard"  : idCard

};

[self uploadMoreUserInfoNetworking:params];

}

}

}

}

你可能感兴趣的:(请输入正确的身份证号)