I am trying to draw a line
my Code is this
-(void) drawRect:(CGRect) rect
{
NSLog(@"Reached Draw ARect Function");
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(ctx, 2.0);
CGContextSetRGBStrokeColor(ctx, 1.0, 2.0, 0, 1);
CGContextMoveToPoint(ctx, 0, 0);
CGContextAddLineToPoint( ctx, 100,100);
CGContextStrokePath(ctx);
}
and i am calling from the viewDidLoad as follows
- (void)viewDidLoad {
[super viewDidLoad];
CGRect k = CGRectMake(1.0, 1.0, 100.0, 200.0);
[self.view drawRect:k];
}
Can any one help me please?