-1

Recently I realize that in URL path to local file one path element changed: /private/var/mobile/Containers/Data/Application/A6ED77D7-3A57-47BC-BD41-B1F857529D0F I mean A6ED77D7-3A57-47BC-BD41-B1F857529D0F sometimes it stay the same and sometimes it is different than before.

I found this when after I save the whole path in db I wasn't able to read a file again because FileManager said that file doesn't exist.

I'd like to ask what this id is, when it changes?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
LakaLe_
  • 454
  • 1
  • 6
  • 15
  • can u add the code where it saves the file and when it is store in your database. – carlos salzar May 22 '17 at 14:11
  • It's an ID for your app data container. When you save a path in your data base never save the full path, but just the last part and use for example `NSDocumentDirectory` to get the path to the document directory. – rckoenes May 22 '17 at 14:11
  • 1
    Don't save the whole path, save what's after. It's a identifier, should be some hash/UUID with build name, date, version, etc.? That's why it may change after rebuild/install/ – Larme May 22 '17 at 14:12
  • @rckoenes when it changes? after every installation or after every start up? – LakaLe_ May 22 '17 at 14:18
  • After installation and update as far as I can tell. But you should really read the answers of the linked question. This contains a link to [File System Programming Guide](https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/AccessingFilesandDirectories/AccessingFilesandDirectories.html#//apple_ref/doc/uid/TP40010672-CH3-SW10) which explains all you need to know about the iOS filesystem. – rckoenes May 22 '17 at 14:20

1 Answers1

0

That is just a path to the documents directory which will be changed everytime you run the application. Following would be helpful for you: FileManager says file doesn't exist when it does

Zohaib Ejaz
  • 387
  • 4
  • 18