title: How to get the count/length of string displayed in UITextView?
body: <p>I have given a large text to display in different text views. So i have set the whole text content in an <code>NSTextContainer</code>.Then added a <code>NSLayoutManager</code>. Created NSTextContainers for different <code>UITextViews</code>. I got continuous text in different <code>TextViews</code> . But i cant limit the no of textviews using a condition.</p>
  
  <p>My problem is i want to create textviews accroding to the content. And the content may vary.I tried to create a condition bw whole text content &amp; textview's content. But even though each contains different text, all <code>textview.text length</code> returns the same value as the length  of the entire text content !!!!</p>
  
  <p>Here is the code>></p>
  
  <pre><code>-(void)paginate:(NSString*)chapterData WithSize:(CGRect)frame
  {
      int stringLength,totalTextViewsTextLength;
      totalTextViewsTextLength=0;
  
  
      NSString* htmlString = [NSString stringWithContentsOfFile:chapterData encoding:NSUTF8StringEncoding error:nil];
  
      NSAttributedString *temp=[[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUTF8StringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: [NSNumber numberWithInt:NSUTF8StringEncoding]} documentAttributes:nil error:nil];
  
  
      NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:temp];
      NSLayoutManager *textLayout = [[NSLayoutManager alloc] init];
      [textStorage addLayoutManager:textLayout];
  
      stringLength=[temp length];
  
  
      while (totalTextViewsTextLength&lt;stringLength)               // checks whether all the content has been added to textview or not
      {
  
          NSTextContainer *textContainer = [[NSTextContainer alloc] initWithSize:frame.size];
          [textLayout addTextContainer:textContainer];
  
  //        textContainer.lin
          UITextView *textView=[[UITextView alloc]initWithFrame:frame textContainer:textContainer];
          textView.tag=textviewCount;
  
  
  
          // Store textviews in array
          [pagedData addObject:textView];
  
  
          totalTextViewsTextLength+=[textView.text length];
          textviewCount++;
  
      }
  
  }
  </code></pre>
  
  <p>What i need is to get the length of text displayed in each textview(that contains different textcontainers ) ??????</p>