title: UITextView: How to programmatically set selectedRange and becomeFirstResponder?
body: <p>I have a UITextView containing a document.  If the user touches the document, the insertion point (selectedRange property) is set appropriately and the UITextView becomes the first responder (keyboard appears).  YAY!</p>
  
  <p>How can I do the same thing programmatically?  Let's say I have a button titled "Edit at character 1,000".  I want that to set selectedRange to [1000, 0] and then make the textview become the first responder.</p>
  
  <p>Problems...</p>
  
  <ol>
  <li><p>textview.selectedRange setter only seems to have an effect when called from viewDidAppear.</p></li>
  <li><p>[textview becomeFirstResponder] sets the insertion point to the end of the document.</p></li>
  </ol>
  
  <p>So, the best I can do is first becomeFirstResponder and then set selectedRange.  The user sees the view scroll to the bottom of the document and then back up to the desired insertion point.  Kinda ugly.</p>
  
  <p>Should I try to hide the ugliness by hacking 'scrollEnabled' and 'editable' flags during the transition?  Or is there a better way to do this?</p>