I have the following code:
- (IBAction)topSecretFetchComplete:(ASIHTTPRequest *)theRequest{
strFinal = [theRequest responseString];
NSLog(@"Sattus Code : %@",[theRequest responseString]);
[self GoTo];
}
I am using ASIHttp for log in. If the login is ok strFinal
is set to successfully
, if not is set to failed
.
my GoTo
method is
-(void)GoTo{
NSString *failStr = @"failed";
NSString *successStr = @"successfully";
if (strFinal == successStr) {
//Navigate to other xib
}else
if (strFinal == failStr) {
UIAlertView *AlertFail = [[UIAlertView alloc] initWithTitle:@"LogIn Failed !" message:@"Wrong ID or Password" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[AlertFail show];
}
}
}
The problem is that the alert is not displayed unless strFinal
is failed.