How to reload a uiview???

Discussion in 'iOS Programming' started by sspbond007, Aug 20, 2008.

  1. sspbond007 macrumors member

    Aug 19, 2008

    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???

  2. kainjow Moderator emeritus


    Jun 15, 2000
    Never call drawRect: yourself. That is called automatically when your view needs drawing. To make your view redraw use
    [view setNeedsDisplay];
  3. sspbond007 thread starter macrumors member

    Aug 19, 2008

    thanks a lot,
    it worked for me

Share This Page