title: how can i set a alert when wrong username or password authentication on ASI Http Request?
body: <p>for me i have done asi http request .but when i call this methode on login page.how can i set authentication alert view for false login the method of ASI HTTP Request is below     </p>
  
  <pre><code>-(void) authenticate:(NSString*) uname password:(NSString*) pwd{
  
  NSString *format = @"%s %d";
  NSLog(format, __FUNCTION__);
  
  myAppDelegate *appDelegate = (myAppDelegate *)   [[UIApplication sharedApplication]delegate];
  appDelegate.HUD.progress = 0.1f;
  appDelegate.HUD.labelText =  @"Authenticating...";
  
  NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/login",appDelegate.appData.server]];
  ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
  request.shouldPresentCredentialsBeforeChallenge = YES;
  [request addBasicAuthenticationHeaderWithUsername:uname andPassword:pwd];
  
  
  [request setDidFailSelector:@selector(authenticationFailed:)];
  
  request.userInfo = [NSDictionary dictionaryWithObject:@"authenticate" forKey:@"type"];
  
  [request setDelegate:self];
  [request startAsynchronous];}
  </code></pre>