Code:
-(IBAction)loginAction:(id)sender
{
NSString *unStr = [[NSString alloc] initWithString:usernameField.text];
NSString *passStr = [[NSString alloc] initWithString:passwordField.text];
if([unStr compare:@"druser"] && [passStr compare:@"password"])
{
//Load Main View Here
}
else
{
UIAlertView *failAlert = [[UIAlertView alloc]
initWithTitle:@"Login Failed"
message:@"The username and password you supplied were not found in our system, please check your credentials and try again."
delegate:nil
cancelButtonTitle:@"Go Back" otherButtonTitles:nil];
[failAlert show];
[failAlert release];
}
}
The code launches, but IF i type 'druser' and 'password' as the username and password, it launches the else code block??? Maybe I'm missing something?
Also,
I have a UITextField, how do I mask it so that as I input text into it, it comes up like a password (the black circles instead of the actual text)