PDA

View Full Version : How to reload a uiview???




sspbond007
Aug 20, 2008, 04:37 PM
Hi,

I'm drawing graph in method drawRect of UIView. This view is set to view of TabBarButton.Whenever this tab is opened it perfectly draws and display graph, but I need that,at some button click the view redraws the graph if there are some changes in record.
I tried this by calling drawRect method again, the executed with new records but the graph didn't change accordingly.
please somebody help me out, how to recall the drawRect method or refresh the graph???

Thanx



kainjow
Aug 20, 2008, 06:39 PM
Never call drawRect: yourself. That is called automatically when your view needs drawing. To make your view redraw use [view setNeedsDisplay];

sspbond007
Aug 20, 2008, 11:26 PM
Never call drawRect: yourself. That is called automatically when your view needs drawing. To make your view redraw use [view setNeedsDisplay];


thanks a lot,
it worked for me