- (BOOL)checkUsername
{
    NSString * regex = @"^[A-Za-z0-9]{1,15}$";
//正则表达式 NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
//Cocoa框架中的NSPredicate用于查询,原理和用法都类似于SQL中的where,作用相当于数据库的过滤取 BOOL isMatch = [pred evaluateWithObject:userNameField.text];
//判读userNameField的值是否吻合
return isMatch; }

 

- (BOOL)checkPassword
{
    NSLog(@"passsowrd:%@",passwordField.text);
    if (passwordField.text.length > 0) {
        return YES;
    }
    return NO;
}

 

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2022-01-09
  • 2022-02-01
  • 2021-12-22
  • 2022-12-23
  • 2022-01-12
猜你喜欢
  • 2022-12-23
  • 2022-01-18
  • 2021-12-05
  • 2021-12-18
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案