Hi, I came across this question a while ago regarding saving and loading files through scripting. I am using BinaryFormatter to serialize and deserialize my data. When I try plugging in a SerializationBinder, I can save and load perfectly in Unity, but when I run on device, it crashes. Specifically, it can serialize() on device, but it crashes when deserialize() is called.
As soon as I remove the line of code (where I assign the binaryFormatter.Binder field), the iPhone works perfectly, and (as expected) Unity cannot save and load properly.
Is there something I'm doing wrong? Or should I perform a check if I'm on device and disable the binder? If I should check, what's the convention for checking the platform in C#?
SerializationBinder may be attempting to perform JIT compilation at runtime which iOS does not allow. Serialization classes are a minefield for this, I ran into a similar issue when working with XML serialization. I'm afraid I've found no good solution.
Same problem here. I want to the SerializationBinder but I got this exception during program execution :
EXC_BAD_ACCESS at first call of VersionDeserializationBinder().
Someone got a solution since Nick’s problem or not ?
So I tought I must just write my save data with serialize / deserialize on mobile plateform ?
Last question, Android allow that or it’s like iOS ?