title: creatig a asynchronus request
body: <p>I am trying to implement an asynchornus request . I did my research and this is the best I got but the code is full of errors that I do not find the solution for</p>
  
  <pre><code>   NSURL *url2 = [NSURL URLWithString:@"www.google.com"];
  
      NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url2];
      NSOperationQueue *queue = [[NSOperationQueue alloc] init];
  
      [NSURLConnection sendAsynchronousRequest:urlRequest queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
      {
          if ([data length] &gt; 0 &amp;&amp; error == nil)
              [delegate receivedData:data];//i get the error here use of undeclared identifier 'delegate' ,when I put self insead I receive the error : no visible @interface for "my class name"  declares the selector "received data"
          else if ([data length] == 0 &amp;&amp; error == nil)
              [delegate emptyReply];//same error here 
          else if (error != nil &amp;&amp; error.code == ERROR_CODE_TIMEOUT) //the error here is "use of undelcared identifier ERROR_CODE_TIMEOUT
              [delegate timedOut];//error here is save as the first one
          else if (error != nil)
              [delegate downloadError:error];//error here is save as the first one
      }];
  </code></pre>
  
  <p>I have added <code>NSURLConnectionDelegate</code> in my .h file </p>
  
  <p>can somebody tell me what is the error ?</p>
  
  <p>Thanks</p>