пʼятниця, 20 травня 2011 р.

CGAffineTransformInvert - singular matrix error

Being inaccurate with affine transformations (and in some other cases) you can easily get a kind of this CoreGraphics error:

<Error>: CGAffineTransformInvert: singular matrix.

There are at least two possibilities why you get this:

A) 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).

B) What can be worse - you don't have a clue about affine transformations and matrices and have never used them in your code but still get this error. One reason I have found is scaling you UIScrollView instance to 0 scale using either setZoomScale:animated: method or zoomScale property. Check your scroll views.

Немає коментарів: