Skip to content

Instantly share code, notes, and snippets.

@n9986
Created September 8, 2012 11:37
Show Gist options
  • Save n9986/3673973 to your computer and use it in GitHub Desktop.
Save n9986/3673973 to your computer and use it in GitHub Desktop.
Get a NSURLRequest object for a resource with path and type
-(NSURLRequest *)getURLRequestForResource:(NSString *)fileName ofType:(NSString *)type
{
NSString *bundleFilePath = [[NSBundle mainBundle] pathForResource:fileName
ofType:type];
NSURL *bundleURL = [NSURL fileURLWithPath:bundleFilePath];
NSURLRequest *bundleFileRequest = [NSURLRequest requestWithURL:bundleURL];
return bundleFileRequest;
}
@n9986
Copy link
Author

n9986 commented Sep 8, 2012

Useful for loading requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment