Skip to content

Instantly share code, notes, and snippets.

@splhack
Created April 19, 2011 12:59
Show Gist options
  • Save splhack/927491 to your computer and use it in GitHub Desktop.
Save splhack/927491 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
typedef void (^completeBlock_t)(NSData *data);
typedef void (^errorBlock_t)(NSError *error);
@interface AsyncURLConnection : NSURLConnection
{
NSMutableData *data_;
completeBlock_t completeBlock_;
errorBlock_t errorBlock_;
}
+ (id)request:(NSString *)requestUrl completeBlock:(completeBlock_t)completeBlock errorBlock:(errorBlock_t)errorBlock;
- (id)initWithRequest:(NSString *)requestUrl completeBlock:(completeBlock_t)completeBlock errorBlock:(errorBlock_t)errorBlock;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment