Hi there,
My app is saving data to a Realm file on device. It supports multi-languages.
But now I found I'm facing a problem: whenever the language of the device or the simulator changes, the directory of app's document changes too.
Here is the example for simulator:
file:///Users/***/Library/Developer/CoreSimulator/Devices/DE161806-933E-4E99-983A-4CA2D9106CAC/data/Containers/Data/Application/059FD12F-433D-40BF-984C-4B08474182D4/Documents/aaa.realm
Here is the example from device:
var/mobile/Containers/Data/Application/F0A4F7C8-2319-4978-B600-EE1CDC38D3E1/Documents/main.realm
The underlined part changes each time when language of the device changes.
I also tried to download beta test version from TestFlight. Same installation, change the language of the device, the result is different. So I'm sure the URL of the Document changes every time the language changes.
The URL directory I got it as:
URL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0], isDirectory: true)
Is there a way to keep the document directory same, regardless the language chose?
Thanks a lot!