You have a UIViewCustomClass in which there is also a UIView ? Something like this :
@interface MyView : UIView
{
AnotherView *aView;
}
That's right ?
So if you want to redraw the "aView" variable you have to override the setNeedsDisplay method in you MyView class :
.h
@interface MyView : UIView
{
AnotherView *aView;
}
- (void)setNeedsDisplay;
-(void) drawRect:(CGRect) r;
@end
.m
@implementation MyView
- (void)setNeedsDisplay
{
[super setNeedsDisplay];
[aView setNeedsDisplay];
}
-(void) drawRect:(CGRect) rect
{
//Do your own custom drawing for the current view
}
@end
Edit:
Here, aView si a custom class too (type of AnotherView), so you can override draw rect method as we do previsouly with MyViewClass :
in AnotherView.m :
@implemetation AnotherView
-(void) drawRect:(CGRect) rect
{
//Do drawing for your aView variable ;)
}
@end
According to apple guideline you should NEVER call drawRect directly (cf documentation)