title: UIKeyboard return button action different from UITextView resignFirstResponder
body: <p>I have a UITextView for the user to enter som text. When the UITextView is called with:</p>
  
  <pre><code>[textView becomeFirstResponder];
  </code></pre>
  
  <p>I add a rightBarButtonItem, which lets the user to dismiss the UIKeyboard with:</p>
  
  <pre><code>[textView resignFirstResponder];
  </code></pre>
  
  <p>I wonder if I can wire the return key of the UIKeyboard to do some action but also to dismiss it self. Action is to save some data added to the textView. </p>
  
  <p>So how can implement to actions, where both call resignFirstResponder but do different things. </p>
  
  <p>Here is the code i use.</p>
  
  <pre><code>-(void)viewDidLoad {
    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] 
      initWithTitle:@"Cancel"
      style:UIBarButtonItemStyleBordered
      target:self action:@selector(cancelEditing)] autorelease];
  }
  - (void)textViewDidEndEditing:(UITextView *)textview {
      [self saveSomeData];
  }
  
  - (void)cancelEditing {
      [commentTextView resignFirstResponder]; 
  }
  </code></pre>
  
  <p>I this possible do I understand that resignFirstResponder also calls textViewDidEndEditing in both cases.</p>
  
  <p>Thanks in advance! </p>