Created
June 2, 2011 07:02
-
-
Save icomkid/1004042 to your computer and use it in GitHub Desktop.
[iOS] Convert a bundle resource path to URL
This file contains hidden or 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
NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"intro" ofType:@"mov"]; | |
NSURL *url = [NSURL fileURLWithPath:resourcePath]; |
I've been looking for this answer for 2 days. Thank you kristopherjohnson! the file's path wasn't working, all i needed was the url for resource. Most of the q&a's from stackoverflow were saying it was kinda confusing to get an url for an local image but... you've made it. Thank you again. :)
and where is tha file "@intro"??
I am trying to give path of an image selected from Photo Library (Simulator) and it is always nil
let URL = NSBundle.mainBundle().URLForResource("(localPath)", withExtension: "JPEG")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With iOS 4.0 and later, you do this: