title: How to calculate if NSString is too long for drawInRect
body: <p>I am adding a variaty of different lengths to a pdf I am creating and I used the following code to write txt to the pdf.</p>
  
  <pre><code>if (subLocationCellTextString.length &gt; 0) {
                  NSString *areaLocationString = @"Area Location:";
                  [areaLocationString drawInRect:CGRectMake(290.0, 195.0, 100.0, 25.0) withAttributes:blackAttributes];
                  // line
                  [self drawLineDarkGreyRect:290.0 StartB:215.0 FinishA:555.0 FinishB:215.0];
  
                  [subLocationCellTextString drawInRect:CGRectMake(382.0, 195.0, 200.0, 20.0) withAttributes:grayAttributes];
              }
  </code></pre>
  
  <p>There are a few occasions where subLocationCellTextString is too long for the drawInRect that I make. I would like to know if there is a way to calculate the size of the NSString so if it is too large then I can wordwrap to a second line.</p>