i was trying out quartz 2d today and i got to learn basic drawing and other things, but now, somehow everything i do doesn't draw a thing on the iphone screen! i tried making a new project and starting from scratch but still no luck... first, i made a new view based application, and then created a new file (.h and .m) as a subclass of UIView. In the implementation, i just overrode the drawRect method, and nothing happens! heres the code:
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGFloat red[4] = {1.0f, 0.0f, 0.0f, 1.0f};
CGContextSetStrokeColor(context, red);
CGContextBeginPath(context);
CGRect rectangle = CGRectMake(0, 0, 400, 200);
CGContextAddRect(context, rectangle);
CGContextSetFillColor(context, red);
CGContextFillPath(context);
}
i have another project that i started before and have the exact same code in and that runs perfectly... so i think i changed some settings or something.. can anyone help?
EDIT: there is nothing i forgot, im sure of it, since i've been doing what i did in my last project, but somehow, it doesnt draw in this one...