title: detect if website login failed objective-c?
body: <p>Just a quick one how do i detect if a login failed here is my code:</p>
  
  <pre><code>- (IBAction)btnTimetable:(id)sender {
      NSString *user = _txtUsername.text;
      NSString *pass = _txtPassword.text;
      NSString *content = [NSString stringWithFormat:@"username=%@&amp;password=%@", user, pass];
      NSData *data =[content dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
      NSString *postlenght=[NSString stringWithFormat:@"%lu",(unsigned long)[data length]];
  
      NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://moodle.thomroth.ac.uk/login/index.php?mode=login"]];
      [request setHTTPMethod:@"POST"];
      [request setValue:postlenght forHTTPHeaderField:@"Content-Length"];
      [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Length"];
      [request setHTTPBody:data];
      //NSError *error=nil;
      //NSURLResponse *response=nil;
      //NSData *result=[NSURLConnection sendSynchronousRequest:request returningResponse:&amp;response error:&amp;error];
  
      [_webView loadRequest:request];
      [self performSelector:@selector(parseTimetable) withObject:nil afterDelay:3.0];
  }
  </code></pre>
  
  <p>i dont even know where to start on this one is there a delegate method to detect such actions ?</p>