Created
September 8, 2012 11:37
-
-
Save n9986/3673973 to your computer and use it in GitHub Desktop.
Get a NSURLRequest object for a resource with path and type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful for loading requests.