Skip to content

Instantly share code, notes, and snippets.

@coylums
Forked from splhack/ASyncURLConnection.h
Created October 20, 2011 19:49
Show Gist options
  • Save coylums/1302136 to your computer and use it in GitHub Desktop.
Save coylums/1302136 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