IOS: save a csv o txt file when I delete an app - ios

I'm creating an app and when a person use this app, lot informations are recorded in a txt file;
If I want to make changes at this app, I must delete app from device. Then, how can I save the txt file before I delete the application?
Is there a way to do this?

Instead of deleting the app to make changes, install an updated app with the old app in place to preverve the content of the Documents folder (NSDocumentDirectory).
You could also save the data in the cloud whenever the app exits.

Related

How to download files to app from app folder without linking an account via Dropbox API?

How do you automatically download a file from Dropbox, say a .txt or .pdf file, from the app folder (Dropbox) programmatically without having the user link their account and do it manually? Is this even possible? The goal is to eventually display the file in the app.
Edit: I would like to clarify that the file would NOT be the user's. I am just trying to get my OWN file from the app's folder which is located under the developer's Dropbox AKA me.
Edit 2: I will be updating this file, which is why I'm storing it remotely on Dropbox. (to avoid having to repeatedly update the whole app) The purpose is to simply use my Dropbox as a database to retrieve this file from.

Fetching previous saved database file after reinstalling the app

I am new to ios development so please pardon if I am asking a silly question.
I need to check if my sql file from the previous installation of the same app exists in the device directory already. If yes, then I need to fetch that file instead of making the new one. But the bundle folder of the app changes after reinstalling the app. So I cant guess the name of the previously installed app bundle folder. I tried to save it elsewhere on the device, but it isn't allowing me. Please suggest me the solution.
What you're asking for isn't possible. If an app is removed, all its files are deleted as well. In iOS, there is no app-neutral place to store files. When an app is merely updated, the update happens "in place" from the perspective of the app, and all previous files are available.
If you want files to survive a delete-reinstall cycle, you'll have to use a cloud service, such as iCloud, Dropbox or Google Drive.
once app is deleted. Application bundle and document directory and all files (including SQLite file)are deleted. u have to fetch all data from API.
In iOS each application is a Sandbox. This Sandbox consists of Application bundle and Mutable part where you store your database and other files which are mutated during the life span of an application.
When you delete the application, entire Sandbox is removed. The only thing which does not get remove is the data which you have stored in keychain.
When you update the application, only application bundle gets updated and Mutable part remain un-touched. So while re-installing the application when it is already present (technically updating the existing application on the device), you can find the same file from the same location.
You can do one thing you can take daily backup of that file on remote server and when you reinstall app check that file exist on server if exists than download else create new.

Keep File on iOS Device after App Update

Is there any way to create a file, which will not be erased after iOS has updated the app?
Scenario: My app saves a text file to the device, and after updating the app, some users are reporting that the text file is not there. Is there any way to preserve the files?
Thanks.
If you store the file in document directory then I should be there unless in the new version you create another file with same name and replace the previous one.

iOS Documents/Inbox folder new coming data

I'm writing an ios app and I managed to add it to "open with.." feature for any other types.My question is after I opened the file with my app how can handle it? I know it will be saved in Documents/Inbox folder in the app however my app will be dynamic and will extend in time.I need to access initially opened file's variables (like name, path etc).
My second question is, after I get the file I want to show ViewController1 rather than when the app normally started ViewController. Should I need to store the count of Documents/Inbox files or are there any other ways?

How to save data from version to version in iphone app development?

I'm having a problem for my app, a Chinese-English dictionary. I'm now adding a wordbook for it, and try to save the contents of it to a plist every time users exit the app. But now I find that as my app updates, all these data will get lost because the path of the app is changed.
I'm now working for a company so the app will keep releasing new versions, and how can I save the data from version to version?
all these data will get lost because the path of the app is changed.
That would indicate you're writing to your application's directory structure. Don't do that.
The iPhone has a documents directory.
Document Directory discussion

Resources