I have seen many posts about this problem but didn’t get an answer. I have a controller which view is added to the main window. The controller’s view has a subview which has a drawRect. The problem is that this function is never called even if I call [self setNeedsDisplay].
Thanks
It is
-(void)drawRect:(CGRect)rectright? Make sure the method signature is correct, and you don’t omit therectargument even if you don’t use it.-setNeedsDisplayshould be called the the subview, notself.Also,
-setNeedsDisplaywon’t call-drawRect:immediately. It only flushes the graphics cache so that-drawRect:is forced to be called in the next update of the frame.