I canโt understand what the problem is. I have a very simple UIViewController with a very simple viewDidLoad method:
-(void)viewDidLoad { NSLog(@"making game view"); GameView *v = [[GameView alloc] initWithFrame:CGRectMake(0,0,320,460)]; [self.view addSubview:v]; [super viewDidLoad]; }
And my GameView is initialized as follows:
@interface GameView : UIView {
and it just has a new drawRect method:
- (void)drawRect:(CGRect)rect { [super drawRect:rect]; NSLog(@"drawing"); }
In my console, I see โcreating a game view,โ but the โdrawingโ is never printed. What for? Why is my drawRect method not called in my custom UIView. I'm literally just trying to draw a circle on the screen.
Codeguy
source share