title: Limit number of characters in uitextview - I have 5 text view same page
body: <p>I have five textview in same page. But just one textview editable. i wanna limit this textview characters. 
  I use  <code>- (void)textViewDidChange:(UITextView *)textView</code> but it didn't work.
  My <code>UITextView</code> reference name is  UserNote.
  I try <code>- (void)textViewDidChange:(UITextView *)UserNote</code> 
  Unfortunately did not work again.<br>
  Please help me. Thanks.
  I Change My reference Name it is textView now.</p>
  
  <p>My Code  ; </p>
  
  <pre><code>@property (retain, nonatomic) IBOutlet UITextView *textView;
  
  - (void)textViewDidChange:(UITextView *)textView{
      NSUInteger length;
      length = [textView.text length];
  
      NSString * last = [NSString stringWithFormat:@"%lu", 160 - length];
  
      [_characterLabel setText:[NSString stringWithFormat:@"%@",last]];
  
      NSLog(@"%@" , last);
  }
  
  - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
      // Prevent crashing undo bug – see note below.
      if(range.length + range.location &gt; textView.text.length)
      {
          return NO;
      }
  
      NSUInteger newLength = [textView.text length] + [text length] - range.length;
      return (newLength &gt; 160) ? NO : YES;
  }
  </code></pre>