Super quick tip!
I’ve come up with a problem when making a generic data serialization method in which I write my data to a binary file, which is an error that only occurs on iOS because it can’t run JIT ( Just-in-time ) compilation and/or AOT ( Ahead-of-time ) compilation because it doesn’t allow runtime code generation.
So, yup, my solution was to add that same piece of code on the file where I am invoking the code.
void Awake( )
// Forces a different code path in the BinaryFormatter that doesn't rely on run-time code generation (which would break on iOS).
So just in case, I’ll leave this here for future reference. 😉