iOS开发 判断扫码是否为有效网址

- (BOOL)achiveStringWithWeb:(NSString *)infor

{

  NSString *emailRegex = @"[a-zA-z]+://.*";

  NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];

  return [emailTest evaluateWithObject:infor];

}

posted @ 2015-06-05 10:24  D-Ben  阅读(188)  评论(0编辑  收藏  举报