title: UITextView not resizing along woth keyboard showing
body: <p>I have a text view (nib-file) with a UITextView maximised the entire view.</p>
  
  <p>When ever i push the viewcontroller on to the navigationcontroller i load the keyboard in the text view's viewDidLoad method.</p>
  
  <p>My problem is that when i write text that has more lines than there is space for, the text is behind the keyboard. I followed the sampe from Apple <a href="http://developer.apple.com/library/ios/#samplecode/KeyboardAccessory/Listings/Classes_ViewController_m.html%23//apple_ref/doc/uid/DTS40009462-Classes_ViewController_m-DontLinkElementID_6" rel="nofollow">here</a>.</p>
  
  <p>If i log the "newTextViewFrame" it's NULL. but if i debug the thing it has a fine value.
  Even if i hardcode it, the UITextView doesent change size.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>- (void)keyboardWillShow:(NSNotification *)notification {
  
  /*
   Reduce the size of the text view so that it's not obscured by the keyboard.
   Animate the resize so that it's in sync with the appearance of the keyboard.
   */
  
  NSDictionary *userInfo = [notification userInfo];
  
  // Get the origin of the keyboard when it's displayed.
  NSValue* aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
  
  // Get the top of the keyboard as the y coordinate of its origin in self's view's coordinate system. The bottom of the text view's frame should align with the top of the keyboard's final position.
  CGRect keyboardRect = [aValue CGRectValue];
  keyboardRect = [self.view convertRect:keyboardRect fromView:nil];
  
  CGFloat keyboardTop = keyboardRect.origin.y;
  CGRect newTextViewFrame = self.view.bounds;
  newTextViewFrame.size.height = keyboardTop; - (self.view.bounds.origin.y);
  
  // Get the duration of the animation.
  NSValue *animationDurationValue = [userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey];
  NSTimeInterval animationDuration;
  [animationDurationValue getValue:&amp;animationDuration];
  
  // Animate the resize of the text view's frame in sync with the keyboard's appearance.
  [UIView beginAnimations:nil context:NULL];
  [UIView setAnimationDuration:animationDuration];
  
  createListingTextView.frame = newTextViewFrame;
  
  [UIView commitAnimations];
  NSLog(@"Textview resized: %@", newTextViewFrame);
  </code></pre>
  
  <p>}</p>
  
  <p>My task i simple: Implement a View with a UITextView and the keyboard open and scroll the UITextView when ever the text exceeds.</p>
  
  <p>Please advice...</p>