I have a situation where my app launch another app for opening and editing file. After I edit the file, where the edited file will be saved - in my app directories or in the launched app directories ?
Asked
Active
Viewed 76 times
0
-
1how do you launch the other app? If everything is sandboxed, you probably won't be able to get access to the other app's "Documents" directory. – Michael Dautermann Oct 24 '17 at 09:23
-
I use "open in" where i choose the other program. The file is in my "Documents" directory. So you say that edited document will be saved in the text editor application directory ? – Bozhidar Marinov Oct 24 '17 at 09:30
1 Answers
0
Once you pass along your file to another app via "Open In", it will save any changes into it's own Documents folder.
There's a couple ways you could access that document but none of them are particularly easy or straightforward. E.G. UIDocumentInteractionController, UIActivityViewController (i.e. you would need to publish your own app as being able to "Open In" for any app that edits your documents). Other possibilities can be seen in this related question.
If your app and the editing app are in the same "App Group", then that would be a nice solution as well. More information can be seen here.
If none of these work for you, your app is kind of stuck in its own sandbox.

Michael Dautermann
- 88,797
- 17
- 166
- 215
-
I do not have control over the other application. Is there any way to override my file instead of create a copy in its Documents folder ? – Bozhidar Marinov Oct 24 '17 at 10:04
-
not that I know of. And if there were, it'd probably be a security risk (i.e. if your app could force another app to save into your directory, then what would stop somebody from stealing documents/pictures?) – Michael Dautermann Oct 24 '17 at 10:25