- Home /
IOS EXC_BAD_ACCESS code=2 ?
Hello everyone, i'm having a big issue on IOS development. Whenever i try to launch the app it through Xcode it gives me an error EXC_BAD_ACCESS(code=2, address=0x8F2373(smth like this address)). Now i know that this problem has been occurred many times and i know that it is caused by a null reference code=1 address=0x0, but this is different it says code=2, and i've searched a lot, but as far as i can see no one had this problem. Additional information : the script which is causing it is a UnityScript(JS) which has over 5000 static variables, now i think that the problem is that it is causing some sort of RAM (stack, heap) overflow. But anyway on android devices it works without a single problem. Please help if you have an idea, any thought can be helpful because my project is at risk.. :(. Thanks a lot.
According to this post and some others, this kind of error is caused by an infinite loop.
Answer by hydrox1 · Sep 25, 2018 at 07:38 PM
Well i have already solved this problem. The main problem is that the memory (stack, heap) was sort of being overflowed from over 5k static variables. And that's why it was crashing.
Your answer
![](https://koobas.hobune.stream/wayback/20220612174739im_/https://answers.unity.com/themes/thub/images/avi.jpg)