I'm having a problem saving some data to file. The following line returns a NO:
[self.fileManager createFileAtPath:fileString contents:photoData attributes:nil];
The error code is 3 and the error message is "No such process." The fileString variable points to a filename (e.g., "file://localhost/var/mobile/Applications/... /Library/Caches/photos/2-86290") and photoData is an NSData variable (though a mouseover during debugging tells me it's actually an NSConcreteData variable).
Thanks for reading! Any ideas on this would be terrific.
If fileString begins with file:// then this isn't a path, it is a URL string for a file URL.
If you started with an NSURL object and obtained fileString as follows:
fileString = [someURL absoluteString];
then change it to:
fileString = [someURL path];
Now fileString will have a valid file path that you can pass to the createFileAtPath: method.
Another option, if you want to write the NSData object photoData, is to do:
[photoData writeToURL:someURL atomically:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With