I tried invoking UIGraphicsGetCurrentContext() in other places other than in drawRect. It give me a NULL. Is it true that I can can only get current context in UIView's drawRect: only?
+3
A:
Yes, outside of drawRect, the default context is nil. Before drawRect is called, a view will push its context onto the stack, and pop it after drawRect ends.
Chris Lundie
2009-03-12 06:31:05