title: iOS4 Implementation of -[NSURLConnection sendAsynchronousRequest:queue:completionHandler:]?
body: <p>How can I implement <code>-[NSURLConnection sendAsynchronousRequest:queue:completionHandler:]</code> for iOS &lt; 5?</p>
  
  <pre><code>#if __IPHONE_OS_VERSION_MIN_REQUIRED &lt; __IPHONE_5_0
  
  #import &lt;objc/runtime.h&gt;
  #import "NSURLConnection+iOS4.h"
  
  // Dynamically add -[NSURLConnection sendAsynchronousRequest:queue:completionHandler:].
  void *sendAsynchronousRequest4(id self, SEL _cmd, NSURLRequest *request, NSOperationQueue *queue, void (^handler)(NSURLResponse*, NSData*, NSError*));
  void *sendAsynchronousRequest4(id self, SEL _cmd, NSURLRequest *request, NSOperationQueue *queue, void (^handler)(NSURLResponse*, NSData*, NSError*)) {
  
      // How should we implement this?
  
  }
  
  @implementation NSURLConnection (SendAsync)
  
  + (void)load {
      SEL sendAsyncSelector = @selector(sendAsynchronousRequest:queue:completionHandler:);
      if (![NSURLConnection instancesRespondToSelector:]) {
          class_addMethod([self class], sendAsyncSelector, (IMP)sendAsynchronousRequest4, "v@:@@@");
      }
  }
  
  @end
  
  #endif
  </code></pre>