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 ImageIO: PNG not a PNG file
when I try to load certain PNG files, (for example this one).
Now, obviously the PNG files aren't corrupted because they work on iOS 6 and they sometimes work even on iOS 7, but then sometimes they kick back that error. I can't find any common cause that determines when the error happens, and I'm not doing anything unusual with them that might account for it: my code doesn't touch them other than to load the page in the UIWebView, so it seems to be something that the WebView is doing internally. This, of course, makes it even harder to pin down.
I know this is a weird question, kind of like asking "did Ford change how wheels work", but did Apple change how it handles PNGs in iOS 7? Can anyone think of what might account for this iOS 7-specific error?
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.
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