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
fileStringbegins withfile://then this isn’t a path, it is a URL string for a file URL.If you started with an
NSURLobject and obtainedfileStringas follows:then change it to:
Now
fileStringwill have a valid file path that you can pass to thecreateFileAtPath:method.Another option, if you want to write the
NSDataobjectphotoData, is to do: