title: Draw multiple lines Quartz 2D
body: <p>I want to draw 15 horizontal lines, with 20 points space between them. I can't understand why this code doesn't work.</p>
  
  <pre><code> - (void)drawRect:(CGRect)rect
   {
    // Drawing code
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
    CGContextSetLineWidth(context, 2.0);
    for (int i=20;i+=20;i&lt;=20*15) {
        CGContextBeginPath(context);
        CGContextMoveToPoint(context, 10, i);
        CGContextAddLineToPoint(context, 310, i);
        CGContextStrokePath(context);
  
     }
  
  }
  </code></pre>
  
  <p>Thank you!</p>