Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chhoda

macrumors 6502
Original poster
Oct 25, 2008
285
1
Hi All,

I am doing a custom drawing in view's drawrect method. I need to update that from outside the view. How would I programmatically force a draw operation on the view ?

regards
CH.
 
Surely just:

Code:
[YourClassName.yourView drawRect:newRect];

... and make sure you've imported the header of YourClassName into the calling class so that it can see the yourView object.
 
I think the recommended method is to pass a message to the view telling it what to add to its list of what to update during the next screen refresh (drawRect). Then call the view's setNeedsDisplay so that a screen refresh for the view gets scheduled.

.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.