I am facing a problem during my device test. Below is my code that loads Json data correctly on Editor and iPad however it fails on iPhone with:
I load the Json file from persistentDataPath, and to confirm I can browse the file, so it exists.
I dont understand why the code works fine on IOS device (iPad Air 2) and Editor, however fails on another IOS device (iPhone7)? Did anyone else face the same issue?
string loadFilename = GetSaveFilename();
if (File.Exists(loadFilename))
{
using (StreamReader reader = GetReadStream())
{
JsonUtility.FromJsonOverwrite(reader.ReadToEnd(), data);
}
}
I was able to see all Json data on iPad with Log Viewer. As I ran the same setup on iPhone, first it showed the Json in an encrypted format as it was looking like reading a .dll file with byte characters, but on second run it showed the correct Json data. Is it maybe because the debug I put is acting like a buffer to read to memory and at the FromJsonOverwrite it directly reads data from memory? It seems like another X-Files episode during the coding adventure It is strangeā¦