custom drawing in view

Discussion in 'iPhone/iPad Programming' started by chhoda, Nov 12, 2008.

  1. macrumors 6502

    Joined:
    Oct 25, 2008
    Messages:
    270
    #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.
     
  2. macrumors 6502a

    Joined:
    Oct 24, 2008
    Messages:
    567
    Location:
    Cambridge
    #2
    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.
     
  3. macrumors 603

    Joined:
    Jul 29, 2003
    Messages:
    6,308
    Location:
    Silicon Valley
    #3
    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.

    .
     

Share This Page