I have been looking for a permanent file storage solution on iOS, but there is no good method. Apple only allows operations on the directory in the sandbox, but now the permanent storage solution in the sandbox is not available (when the disk is insufficient, the files in the cache and temp directory will be deleted by the system, the Document directory is not approved by the appstore ).
Today, I think of a method: Save the data to be saved according to the png file format, so that the system can see that our image is actually a png, so we can save the file as album, use the following API
UIImageWriteToSavedPhotosAlbum (UIImage * image, id completionTarget, SEL completionSelector, void * contextInfo );
Similarly, we can store the actual data to be saved in the binary stream of the pdf Based on the pdf file format, so that the pdf can be stored in the iBook, the same can achieve permanent storage.
I don't know if my idea is feasible. I just want it, but I haven't actually verified it. I need to study the png or pdf file format.