Is it possible to not allow unity optimise my code?

Im using litJson in my project and didnt know about the issues with it and ios before I started using it.
The annoying thing is it works fine on a development build with debugging enabled however without debugging it just doesn’t work. The only explanation is that the code is optimised and its the optimised code that doesnt work on ios.

is it possible to not allow unity to optimise a particular script/the whole project?

You can go to Edit > Project Settings > Player, click in the iOS tab, Other Settings and change the Optimisation parameters, like the API compatibility level and SDK version. This is what you can do in Unity, but it doesn’t seem that it will help.