Alexander Wigmore
Alexander Wigmore

Reputation: 3186

iOS/iPad app, saving data locally

I've built a quick iOS app that will be used for surveys (Question/Answer style), saving the data locally to iPad, as there will be no internet access to upload straight away.

How is it possible to access the saved CSV, currently it's saving to the app document root. But from xCode/MacOS there is no way to access this location. Any better way of saving this to a more readily accessible location, or access where it currently is.

Currently using:

NSString *docPath=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0];
NSString *s2goevent=[docPath stringByAppendingPathComponent:@"results.csv"];

Upvotes: 0

Views: 922

Answers (2)

Kesava
Kesava

Reputation: 1060

May not be a direct answer. But you can view the contents of the app including the different files stored in the device using the iexplorer mac app. http://www.macroplant.com/iexplorer/

Upvotes: 1

gregorkas
gregorkas

Reputation: 137

The easiest way would be to log the document folder location and open it in Finder.

NSLog(@"%@", docPath);

You should get a result like this:

/Users/<username>/Library/Application Support/iPhone Simulator/<simulator version>/Applications/<app id>/Documents

copy the url and go to Finder, then use the "Go To Folder..." menu (or press Cmd + Shift + G) and paste the url.

If the app is already on the device:

  1. Open the Organizer (Cmd + Shift + 2)
  2. Select the Devices tab and select a device from the list on the left
  3. Click on Applications and select your application, then browse the files under the "Data files in Sandbox" section. You can also export the files and save them to your computer.

Upvotes: 1

Related Questions