Skip to content

Instantly share code, notes, and snippets.

@omorandi
Created September 23, 2011 15:51
Show Gist options
  • Save omorandi/1237725 to your computer and use it in GitHub Desktop.
Save omorandi/1237725 to your computer and use it in GitHub Desktop.
+ (NSData*) resolveAppAsset:(NSString*)path;
{
NSString *ServerAddr = SERVER_ADDRESS;
NSString *ServerPort = SERVER_PORT;
NSString *path_url = [NSString stringWithFormat:@"http://%@:%@/%@",ServerAddr, ServerPort, path];
NSURL *url = [NSURL URLWithString:path_url];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request startSynchronous];
if ([request responseStatusCode] != 200)
return nil;
NSError *error = [request error];
if (error)
return nil;
return [request responseData];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment