I\'ve got an app that uses a UIWebView
, and everything was (and still is) working perfectly on iOS 6. On iOS 7, though, it is sometimes kicking back an error <
Turns out the problem WAS with the PNG files themselves: someone had opened certain ones in Photoshop to make edits, and those files weren't working under certain conditions. I don't know exactly what it was about them, under the hood, that made them unacceptable to the app, but when we re-exported them, they worked perfectly. Strange, but solved.
Recommendation for anyone reading this with a similar issue: re-export your files, under a variety of settings and conditions if need be, and see if they start working.
It is unlikely that the problem is the PNGs themselves. If it were, then it would fail every time. What is more likely is that you are corrupting the data, likely due to a race condition (since it is intermittent). For example, you may be executing WebKit calls somewhere other than the main thread. You may have gotten away with that on iOS 6, but on iOS 7 enough may have changed to cause the race condition to fail. If you process these PNGs outside of the UIWebView
, you may have a race condition there. Those are the two main places I'd look.