title: Why does the keyboard not show in my UITextView?
body: <p>I have a container class which is a view controller.<br>
  It holds the UITextView for notes and has another view controller as a subview, called it PDFViewController. That one has an array of view controllers, called them PageViewController's, in it and a UIScrollView so i can swipe through the different view controllers from the array.  </p>
  
  <p>Each of the PageViewController's has also an UIScrollView, so i can zoom the different pages.  </p>
  
  <p>But when I show my UITextView i cannot edit or write anything.<br>
  It shows a blinking cursor, but no keyboard and can't write text.<br>
  When i highlight a word from the default text, it shows me some dictionary options but the words won't be replaced.  </p>
  
  <p>I just don't know where the problem might be.   </p>
  
  <p><strong>container.m (View Controller)</strong></p>
  
  <pre><code>- (void) initNotes {
  
  notesVisible = FALSE;
  notes = [[UITextView alloc]initWithFrame:CGRectMake(10, 10, note_width, note_height)];
  notes.backgroundColor = [UIColor yellowColor];
  notes.font = [UIFont fontWithName:@"Arial" size:24];  
  notes.text = @"Hier ist Platz für Ihre Notizen";
  
  container = [[UIView alloc] initWithFrame:CGRectMake(start_x, start_y, container_width, container_height)];
  container.backgroundColor = [UIColor yellowColor];
  [container.layer setShadowColor:[[UIColor blackColor] CGColor]];
  [container.layer setShadowOffset:CGSizeMake(2.0, 3.0)];
  [container.layer setShadowOpacity:0.6];
  [container.layer setShadowRadius:5];
  container.layer.shouldRasterize = YES;
  [container addSubview:notes];
  [self.view addSubview:container];
  }
  
  - (void) showTextView {
  [UIView beginAnimations:@"MoveAndStrech" context:nil];
  [UIView setAnimationDuration:0.4];
  [UIView setAnimationBeginsFromCurrentState:YES];
  [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
  
  container.frame = CGRectMake(start_x, self.view.center.y-container_height, container_width, container_height); 
  
  [UIView commitAnimations];
  
  notesVisible = !notesVisible;
  }
  
  - (void) hideTextView {
  
  [UIView beginAnimations:@"MoveAndStrech" context:nil];
  [UIView setAnimationDuration:0.4];
  [UIView setAnimationBeginsFromCurrentState:YES];
  [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
  
  container.frame = CGRectMake(start_x, start_y, container_width, container_height); 
  
  // [notes resignFirstResponder];
  [UIView commitAnimations];
  
  notesVisible = !notesVisible;
  }
  </code></pre>
  
  <p>@implementation PDFViewController</p>
  
  <pre><code>- (void)awakeFromNib
  {
  painting = false;
  dataInstance = [PDFDataInstance sharedInstance];
  chapter = [dataInstance chapter];
  [self getNumberOfPages];
  kNumberOfPages = dataInstance.pages;
  
  // Register observer to be called when a cell from BookmarkPDFController is pressed
  [[NSNotificationCenter defaultCenter] addObserver:self 
                                           selector:@selector(didSelectBookmark:) 
                                               name:@"bookmarkPressedinPDFView" object:nil];
  // Register observer to be called when a cell from BookmarkPDFController is pressed
  [[NSNotificationCenter defaultCenter] addObserver:self 
                                           selector:@selector(togglePainting:) 
                                               name:@"togglePainting" object:nil];
  
      // view controllers are created lazily
  // in the meantime, load the array with placeholders which will be replaced on demand
  NSMutableArray *controllers = [[NSMutableArray alloc] init];
  for (unsigned i = 0; i &lt; kNumberOfPages; i++)
  {
      [controllers addObject:[NSNull null]];
  }
  self.viewControllers = controllers;
  [controllers release];
  
  // a page is the width of the scroll view
  scrollView.pagingEnabled = YES;
  scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * kNumberOfPages, scrollView.frame.size.height);
  scrollView.showsHorizontalScrollIndicator = NO;
  scrollView.showsVerticalScrollIndicator = NO;
  scrollView.delegate = self;
  scrollView.directionalLockEnabled = YES;
  
  currentPage = [[chapter currentPage] integerValue];
  
  
  // pages are created on demand
  // load the visible page
  // load the page on either side to avoid flashes when the user starts scrolling
  // 
  // Load pages based on currentPage cause of when coming from bookmarks
  [self loadScrollViewWithPage:currentPage];
  [self loadScrollViewWithPage:currentPage+1];
  
  // update the scroll view to the appropriate page
  CGRect frame = scrollView.frame;
  frame.origin.x = frame.size.width * currentPage;
  frame.origin.y = 0;
  [scrollView scrollRectToVisible:frame animated:YES];
  
  
  }
  
  - (void)loadScrollViewWithPage:(int)page
  {
  if (page &lt; 0)
      return;
  if (page &gt;= kNumberOfPages)
      return;
  
  // replace the placeholder if necessary
  PageViewController *controller = [viewControllers objectAtIndex:page];
  if ((NSNull *)controller == [NSNull null])
  {
      //page+1 cause CGPDF indexing starts with 1
      controller = [[PageViewController alloc] initWithPageNumberAndUrl:page+1: [chapter urlOnFilesystem]];
      [viewControllers replaceObjectAtIndex:page withObject:controller];
      [controller release];
  }
  
  // add the controller's view to the scroll view
  if (controller.view.superview == nil)
  {
      CGRect frame = scrollView.frame;
      frame.origin.x = frame.size.width * page;
      frame.origin.y = 0;
      controller.view.frame = frame;
  
      [scrollView addSubview:controller.view];
  
  }
  }
  </code></pre>
  
  <p><strong>TextView delegates</strong></p>
  
  <pre><code>- (void)textViewDidBeginEditing:(UITextView *)textView {
  
  NSLog(@"begin editing");
  }
  
  - (BOOL)textView:(UITextView *)aTextView shouldChangeTextInRange:(NSRange)aRange replacementText:(NSString*)aText
  {
  NSLog(@"something changed"); 
  return YES; 
  }
  </code></pre>