Poor Yahoo!

I just spent a couple hours trying to explain and fix this error:
<Error>: CGAffineTransformInvert: singular matrix.
…reported in my app's log while I was testing my use of the WebKit widget (UIWebView class) to display HTML.

The "CG" means CoreGraphics, Apple's intense pixel-bending technology. One fellow on the internets says the issue is related to matrix math:
Probably you tried to use singular transformation matrix somewhere in your code. You should check your transformation matrices and avoid matrices like:
0 0 0
0 0 0
0 0 1
and others - check out Google how to tell singular 3x3 matrix (hint: it has determinant = 0).
Blah, blah, blah… All I did was try to load a web page. I'm not doing any graphics work.

I tried all kind of folk remedies related to my use of the UIWebView widget, but nothing worked.

Long story, short…

For this testing, I had randomly picked "http://www.Yahoo.com/" out of thin air as an arbitrary page. This error occurred repeatedly on every run. Eventually I switched to Google.com, no problem. Reuters.com, no problem. SeattleTimes.com, no problem. Go back to Yahoo.com, problem. And problem happens repeatedly while scrolling.

I'm guessing that Yahoo is doing some kind of screwy HTML or JavaScript, probably manipulating images or the page itself graphically, and thereby invoking CoreGraphics and generating the error.

Poor Yahoo can't seem to get anything right anymore.

1 comment:

  1. You posed the problem. Cool. Did you manage to avoid it? I came redirected here from stackoverflow.com/questions/17145114, as I am in the exact same situation, but I don't seem to find it anywhere in your blog. Thanks in advance ;)