ios-Password judgment

Source: Internet
Author: User

We often in the project with the user or mobile phone number to log in, then generally with the password to log in successfully.

Here are some of the phone and password forms of judgment:

1- (void) Registbuttonclick: (ID) Sender2 {3     if(Self.phoneTextField.text.length! = One)//cell phone number judgment4     {5         if(Self.phoneTextField.text.length <=0)6         {7Pushview.hidden =NO;8PushView.tiShiLab.text =@"The phone number cannot be empty";9}ElseTen         { OnePushview.hidden =NO; APushView.tiShiLab.text =@"Please enter your phone number correctly"; -         } - [self registreturnkeyboard]; the         return; -     } -     if(Self.passWordTextField.text.length <=0)//Password Judgment -     { +Pushview.hidden =NO; -PushView.tiShiLab.text =@"password cannot be empty, please re-enter ~"; + [self registreturnkeyboard];  A         return; at     } -     if(Self.passWordTextField.text.length <6)//Password Judgment -     { -Pushview.hidden =NO; -PushView.tiShiLab.text =@"password can not be less than 6 digits, please re-enter ~"; - [self registreturnkeyboard]; in         return; -     } toNSString *URL; +     if(Self.passWordTextField.text) -     { theurl = [GetData getRegistWithMobile:self.phoneTextField.text andpassword:[mymd5 Md5:self.passWordTextField.text]];//= = = Wu 611 *}Else $     {Panax NotoginsengPushview.hidden =NO; -PushView.tiShiLab.text =@"The password cannot be empty"; the [self registreturnkeyboard]; +         return; A     } the [self registreturnkeyboard]; +GetData *GD =[[GetData alloc]init]; -Gd.urltag =1; $Gd.datadele =Self ; $ [GD Getdatawithurltest:url]; -}

-(void) Registbuttonclick: (ID) sender

{

if (self.phoneTextField.text.length! = 11)//Phone number judgment

{

if (self.phoneTextField.text.length <= 0)

{

Pushview.hidden = NO;

PushView.tiShiLab.text = @ "Mobile phone number cannot be empty";

}else

{

Pushview.hidden = NO;

PushView.tiShiLab.text = @ "Please enter the phone number correctly";

}

[Self registreturnkeyboard];

Return

}

if (self.passWordTextField.text.length <= 0)//password judgment

{

Pushview.hidden = NO;

PushView.tiShiLab.text = @ "Password cannot be empty, please re-enter ~";

[Self registreturnkeyboard];

Return

}

if (Self.passWordTextField.text.length < 6)//password judgment

{

Pushview.hidden = NO;

PushView.tiShiLab.text = @ "Password can not be less than 6 digits, please re-enter ~";

[Self registreturnkeyboard];

Return

}

NSString *url;

if (Self.passWordTextField.text)

{

url = [GetData getRegistWithMobile:self.phoneTextField.text andpassword:[mymd5 md5:self.passwordtextfield.text]];// = = = Wu 611

}else

{

Pushview.hidden = NO;

PushView.tiShiLab.text = @ "Password cannot be empty";

[Self registreturnkeyboard];

Return

}

[Self registreturnkeyboard];

GetData *GD = [[GetData alloc]init];

Gd.urltag = 1;

Gd.datadele = self;

[GD Getdatawithurltest:url];

}

ios-Password judgment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.