What I wanna do is just accessing to local file system from my iPhone.
I have some files in Library directory.
So, my code is as below.
NSString *dir = @"/Users/MY_ID/Library/Application Support/iPhone Simulator/5.0/Applications/6AB76439-APP-ID-1C1BB92E/Library/test";
NSURL *url = [NSURL fileURLWithPath:dir isDirectory:NO];
Then, what I got for the value of url is,
file://localhost/Users/MY_ID/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/6AB76439-APP-ID-1C1BB92E/Library/test
and both iPhone simulator and a real iPhone CANNOT resolve this url.
I think the problem is this part.
file://localhost
because, without that part, I can read file from string.
But, what I need to do is to get the “test” file via NSURL.
Since [[MPMoviePlayerViewController alloc] initWithContentURL:] method only can read NSURL.
let me read the video file from my local file system.
Thanks!!!
Since this is clearly not useful outside of your local test environment (and hence not portable code anyway), why not just create a “localhost” symlink in the root of your machine?
I wasn’t even aware the MPMoviePlayerViewController could read a file from the local filesystem in this way. For simplicity, why not bundle your movie file into the app or host it on something like dropbox?