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