I´m trying to make a registration form. There are two UITextField to write the Password and to confirm it. When i write exactly the same password, it always shows: "Passwords do not match ".
-(IBAction)signUp:(id)sender{
@try {
if([[name text] isEqualToString:@""] || [[mail text] isEqualToString:@""] || [[phone text] isEqualToString:@""] || [[password text] isEqualToString:@""] || [[rpassword text] isEqualToString:@""] ) {
[self alertStatus:@"Please check every field" :@"¡Alert!"];
}else if (password.text!=rpassword.text){
[self alertStatus:@"Passwords do not match " :@"¡Please Check!"];
}else {
NSString *strURL = [NSString stringWithFormat:@"http://miwebsite.com/signup.php?var1=%@&var2=%@&var3=%@&var4=%@", name.text, mail.text, phone.text, password.text];
NSURL *url2 = [NSURL URLWithString:strURL];
NSLog(@"url: %@", url2);
NSError *error;
NSData *dataURL = [NSData dataWithContentsOfURL:url2 options:0 error:&error];
if (dataURL == nil) {
NSLog(@"error: %@", error);
}
else {
NSLog(@"dataURL: %@", dataURL);
NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
// THE REST OF THE CODE GOES HERE...
}
}
} @catch (NSException * e) {
NSLog(@"Exception: %@", e);
[self alertStatus:@"Sorry." :@"Failed"];
}
}
I used the debugger. password.text and rpassword.text are exactly the same word. ¿Why my code goes inside that sentence?
Thanks in advanced.