I am new to iphone. I am working on my first app. I have a login view,which contains username and password textfields. I try to validate the login page with the following code.but it's not working. Every time,alert view is displaying,What can i do now? Is there any suggestions for this or modified code?
- (IBAction) login: (id) sender
{
NSString *lakshmi;
NSString *narayana;
NSLog(@"login %@",usernameField.text);
if ((usernameField.text== lakshmi)&& (passwordField.text==narayana) )
{
[self.view addSubview:Link_view];
NSLog(@"sucess");
}
else {
NSLog(@"INVALID");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Please Enter User Name & Password"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}