Saturday, March 31, 2012

iOS sdk 5.1 CATiledLayer Bug - Draw gets called twice for every tile

Ok I've been banging my head as to why the CATiledLayer Draw(RectF rect) method is being called twice resulting in memory crashes in my monotouch app in sdk 5.1. This used to work in 5.0.1 with no problems i.e. tiles are rendered only once as it should. However once I upgraded to Lion 10.7.3 and ios sdk 5.1, this bug appears and each tile seems to be rendered twice. I can tell from a simple Console.WriteLine(rect) in the Draw method which outputs the coordinates of the tile being drawn.

The reason I discovered this is because my app started to crash with SCGen checked (MonoDevelop iPhone Build/Advanced/Runtime Options). This bug is confirmed in apple's official devforum: https://devforums.apple.com/message/638091

Note: you will need to have a login to view the post.

In the meantime, the workaround is to NOT use SCGen for production build (I am already NOT using it for prod builds anyway, I am only using it for dev builds because it is still experimental) and build against 5.0.1 if you still can.

Hopefully Apple will release a fix soon.

No comments:

Post a Comment