title: Draw Line using CGContext
body: <p>I want to draw line in table view cell so that I can place textfield &amp; switch in single cell. I increased the height of cell. How can I draw line in cell? </p>
  
  <p>I have subclass of UIView which contains following code</p>
  
  <pre><code> //Get the CGContext from this view
   CGContextRef context = UIGraphicsGetCurrentContext();
   //Set the stroke (pen) color
   CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
   //Set the width of the pen mark
   CGContextSetLineWidth(context, 1.0);
  
   // Draw a line
   //Start at this point
   CGContextMoveToPoint(context, 10.0, 30.0);
  
   //Give instructions to the CGContext
   //(move "pen" around the screen)
   CGContextAddLineToPoint(context, 310.0, 30.0);
  
  
   //Draw it
   CGContextStrokePath(context);
  </code></pre>
  
  <p>Then I have a tableViewController with grouped table style. In cellForRowAtIndexPath I have following code</p>
  
  <pre><code>//code to add textfield
  DrawLineView *drawLine = [[DrawLineView alloc]init];
  [cell addSubview:drawLine];
  //code add switch
  </code></pre>
  
  <p>But it is not drawing any line. I can't use 2 different cells. I have to Please help me. This is my first to deal with graphics i iphone. Thanks</p>