title: Drawing strings from an array in drawrect
body: <p>I am trying to draw strings from an array in drawrect, but they are not being drawn. The drawRect code looks like this</p>
  
  <pre><code>- (void)drawRect:(CGRect)rect
  {
      UIFont *font = [UIFont systemFontOfSize:14];
      CGRect ourRect;
      ourRect.origin.x=ourRect.origin.y=20.0;
      ourRect.size.width=130.0;
      ourRect.size.height= 100.0;
      CGPoint pointer;
      pointer.x=pointer.y=20;
      NSString*string;
      string=[[NSString alloc] init];
  
      [string drawAtPoint:pointer withFont:font];
  
      NSMutableArray * whatShouldIDraw=[[NSMutableArray alloc]init];
      whatShouldIDraw=[self.dataSource whatToDraw:self];
      NSUInteger i;
      for (i=0; i&lt;[whatShouldIDraw count]; i++) {
          [[[whatShouldIDraw objectAtIndex:i] equationBit] drawAtPoint:[[whatShouldIDraw objectAtIndex:i]drawPoint] withFont:font];
      }
  
  }
  </code></pre>
  
  <p>The dataSource protocol is implemented in the view's controller. The objects in the array are of a class that holds a string and a point at which to draw that string. I used NSLog to make sure that the objects were actually getting put into the array properly (they are). Also, there is a line that sends setNeedsDisplay to the view. When I run this code, it comes up blank though, so I am not sure what is going wrong. This is my first attempt to make drawRect run with data that is inputted from within an application, so I imagine the problem comes from how I implemented the datasource protocol. </p>