Can someone explain to me why the following code:
NSString* filePathString = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
NSLog(@"%i", [[NSURL URLWithString:filePathString] isFileURL]);
NSLog(@"%@", filePathString);
outputs:
0
"/var/mobile/Applications/28ADFC19-874C-4304-94B5-F6441CAE9FAD/Documents"
This means that this url isn't a file URL. Obviously, it is.
Background:
I'm trying to use an AVCaptureMovieFileOutput to write a movie recording to a file, but the file url I'm proving gives the error:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[AVCaptureMovieFileOutput startRecordingToOutputFileURL:recordingDelegate:] - Cannot record to URL /var/mobile/Applications/28ADFC19-874C-4304-94B5-F6441CAE9FAD/Documents/media/CrKNjNhe9so2LRnD9iHK.mov because it is not a file URL.'
That looks like a file URL to me, just like the original example. What gives?