title: How to show an alert when we entered wrong secure code using Objective-C in iOS application
body: <p>I have a webservices url which appends with securecode. When I enter correct securecode for example to say abcd, then application will load. when I entered wrong secure code, I need to show alert as 'wrong securecode'. My code is here:</p>
  
  <pre><code>- (void) alertStatus:(NSString *)msg :(NSString *)Title:(int)tag
  {
      UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:Title
  
                                                      message:msg
                                                     delegate:self
                                            cancelButtonTitle:@"Ok"
                                            otherButtonTitles:nil, nil];
      if(tag) 
          alertView.tag = tag;
      [alertView show];
  }
  
  
  -(IBAction)loginClicked:(id)sender {
  
      @try {
  
          if([[txtsecurecode text] isEqualToString:@""]  ) {
              [self alertStatus:@"Please enter Access code" :@"Login Failed!":0];
          } else {
              NSString *post =[[NSString alloc] initWithFormat:@"txtsecurecode=%@",[txtsecurecode text]];
  
              NSURL *url=[NSURL URLWithString:[NSString stringWithFormat:@"http://my example.com/Accountservice/Security/ValidAccess?accesscode=%@&amp;type=1",txtsecurecode.text]];
  
              NSString *responseData = [[NSString alloc]initWithData:[NSData dataWithContentsOfURL:url] encoding:NSUTF8StringEncoding];
  </code></pre>
  
  <p>responseData is the reference where I am getting response from the web services url.so below getting response, I need to keep alert.</p>
  
  <p>How can I keep alert in this case showing alert when entered wrong secure code?</p>