tags:

views:

36

answers:

1

any answer is kindly appericiable

A: 

I assume you're talking about Core Graphics functions like CGContextMoveToPoint, CGContextAddLineToPoint etc.

You can call these functions from where you want but you need a valid context for that. If you're drawing the contents of a UIView, you should do that in drawRect:.

Nikolai Ruhe
In other words, he can't use these calls within the event handling methods, but he can store some information that causes the appropriate drawing to be done in the drawRect: method in response to a -setNeedsDisplay message.
Brad Larson