Hi,
I'm debugging an iOS app and have come across the following warning message:
[WARN] Exception in event callback. { line = 1833; message = "Maximum call stack size exceeded."; name = RangeError; sourceId = 150435104;I'm using Ti SDK 2.0.2 GA. I tried using 2.1.0 but I get the same error and its not as stable as 2.0.2 (i've explained why in other posts).
What can I do?
Thanks for any advice you can provide,
2 Answers
I haven't hit this myself, but I could take a guess at what's going on -- do you have a lot of nested function calls? Recursion? Event listeners triggering more event listeners? Anything that makes your call stack deeper (the "stack" of open function calls) will increase the stack size. Also, I would imagine that the size of the data you're passing to those functions would contribute as well.
Maybe you could catch the exception and look at the call stack in the debugger to see how deep it is...
For me, I ran into this error when I had CommonJS modules which referenced each other. This caused a circular loop where they kept trying to load each other, which seems to be a Titanium bug, as this isn't supposed to be a problem in CommonJS. The iOS simulator didn't show the circular loop, it merely gave the max call stack error. I had to run it in the Android emulator to see the issue.
Your Answer
Think you can help? Login to answer this question!