How can I call the iPhone to draw using other method?

Posted by Tattat on Stack Overflow See other posts from Stack Overflow or by Tattat
Published on 2010-04-05T03:03:51Z Indexed on 2010/04/05 3:13 UTC
Read the original article Hit count: 346

I have a view with a class called "drawingViewController", and I have the drawRect method:

- (void)drawRect:(CGRect)rect {

    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetLineWidth(context, 2.0); 
    CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor); 
    CGContextMoveToPoint(context, 0.0f, 0.0f);
    CGContextAddLineToPoint(context, 100.0f, 100.0f); 
    CGContextStrokePath(context);


}

But I wanna to define some other drawing method, but it did't work, how can I do so apart from calling drawRect method? thz in advance.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone-sdk