I'm currently building an App that uses the krpano viewer, which is a Panorama Viewer built with JavaScript. I'm loading this Panorama viewer in a UIWebView with local images that are saved on the iPad.
But after using the Panorama viewer for a while, I get this error and the app crashes:
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[WebCoreSharedBufferData getBytes:range:]: range {0, 4000} exceeds data length 0'
*** First throw call stack:
(0x2e213f53 0x38a226af 0x2e213e95 0x2eb4dc31 0x2e16ca65 0x2ef4ce47 0x2ef4cd21 0x2ef68f03 0x2ef682db 0x2ef68029 0x2ef67e61 0x2ef67dcf 0x2ef6bd39 0x2ef6b813 0x2ef5471f 0x2e29b2ed 0x30635c6d 0x30635117 0x30621069 0x30620bad 0x3061d949 0x3061c051 0x38f0c297 0x38f0c09b 0x38f0cd15 0x38f0cf8d 0x39047dbf 0x39047c84)
libc++abi.dylib: terminating with uncaught exception of type NSException
Does anyone have an idea why this happens? When I load the online page in the UIWebView there is no problem.
Thanks for your help!
This is probably a memory related issue. When a web application allocates too much memory using Javascript, weird things will happen.
Your best bet is to observe memory warning notifications and try to influence the web app from the outside. Of course this depends on the specifics of the web app but you might want to try disabling userInteractionEnabled
for a while to let the web view catch up with queued user input actions or, if the memory warning persists, try to reload the web view.
Unfortunately there are no easy solutions here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With