0

I have an application which downloads images/context from server. Save images to /documents, context to database coredata.

Let say I've downloaded all the datas (app display all the necessary datas (images/context)) and for some reason I uploaded a new build of the app in testflight I then update the app on my device and when I run the app it now won't display the images that I've downloaded on the previous build but I still have the context. So my question is did the new build remove all the datas inside /documents? If so how come I still have my context datas (database coredata)?

Bordz
  • 2,810
  • 4
  • 23
  • 27

1 Answers1

1

Is your app utilizing an absolute path to the Documents folder? This is bad, as recorded here.

You would normally want to use something like:

- (NSString *)documentsDirectory
{
    if (_documentsDirectory == nil)
    {
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        self.documentsDirectory = [paths objectAtIndex:0];
    }
    return _documentsDirectory;
}

to get the path dynamically. You could then use the following to log it contents and see what's there:

NSArray *documentsDirectory = [fileManager contentsOfDirectoryAtPath:self.dataController.documentsDirectory error:NULL];
NSLog(@"documentsDirectory is: \n%@", [documentsDirectory description]);
Community
  • 1
  • 1
DenVog
  • 4,226
  • 3
  • 43
  • 72