Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I learn more about WebCoreSharedBufferData?

I've got an app that was working perfectly on iOS 6, but on iOS 7, if there is a very specific action taken by the user (too complex to get into but it uses a UIWebView and it's consistent), the app crashes with the error:

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[WebCoreSharedBufferData getBytes:range:]: range {0, 8} exceeds data length 0'

Now I'm more than happy to do some research and experimentation myself, but I just can't find WebCoreSharedBufferData. Google searches reveal several people (like here and here and here and here) who are having similar problems, but their questions either haven't been answered or they're using their apps in ways (like zooming on a map or using 3rd party code) that I'm not doing.

Xcode documentation has never heard of WebCoreSharedBufferData, and a search of my project reveals no references to it. Google searches have left me unenlightened as well, mostly just questions and GitHub projects with 3rd party code I'm not using. I'm assuming it's something deep in Apple's UIWebView functionality, but without being able to learn more about it I'm having a hard time proceeding.

So my question is: does anyone know where I can find information/tutorials/descriptions etc of WebCoreSharedBufferData? I feel like if I understood it a little better I'd be able to find the solution, it's just hard to debug in the dark...

Or alternatively, does anyone just straight-up know what changed with WebCoreSharedBufferData in iOS 7 that might be creating an error like this?

EDIT: A clue provided by kcbanner (who has experienced a similar issue) in the comments below: both of our problems involve pages with canvases and onclick events with those canvases. Maybe something has changed with canvas click handling in iOS 7?

like image 438
Nerrolken Avatar asked Oct 22 '13 17:10

Nerrolken


1 Answers

I just encountered this error also. My set up was phonegap 3.2 and createjs 0.7.0 and I never had an issue with ios6 but ios7 was causing me fits. My solution was to use one canvas element. I had been loading two canvas elements with png spritesheet bitmap data and toggling back and forth, now i just reuse the same canvas element by clearing the old data and adding the new data. Seems to have solved the issue. still don't understand why i can't have two canvas elements.

just a bit more... seems this only occurred when i quickly reloaded the two canvas elements with png data. I don't think it's an issue of corrupted pngs because it would happen on different bitmaps each time and now that i reuse the same canvas element everything works fine.

like image 79
Steve T Avatar answered Oct 23 '22 12:10

Steve T