title: makeFirstResponder won't compile
body: <p>I have an array of buttons and an array of associated NSTextViews (embedded in NSScrollViews), all created programmatically.  All this in a program (a calendar) that compiles and works fine as far as it does.</p>
  
  <p>However, I would like clicking a button to cause the associated text field to behave as if I had clicked directly in it (cursor and focus ring appear and it accepts text).  Right now, I have to click the button AND the text box before I begin entering text.</p>
  
  <p>It appears that “makeFirstResponder” should do what I want, but it won’t compile as I am trying to do it.</p>
  
  <p>Here is the relevant code:</p>
  
  <p>(All in a single View Controller)</p>
  
  <p>Global Declarations:</p>
  
  <pre><code>var arrayOfButtons:[NSButton] = []
  var arrayOfFields: [NSTextView!] = []
  var arrayOfWindows: [NSScrollView!] = []
  </code></pre>
  
  <p>Creation of array of fields:</p>
  
  <pre><code>var i = 0
  
  var myLocalText: NSTextView! = NSTextView(…
      var myLocalWindow: NSScrollView! = NSScrollView(…
  
          for i = 0; i &lt;= 6; i++ {
  
              var myLocalText: NSTextView! = NSTextView(…
              var myLocalWindow: NSScrollView! = NSScrollView(…
  
              view.addSubview(myLocalWindow)
  
              myLocalWindow.hasVerticalScroller = false
              myLocalWindow.focusRingType = NSFocusRingType(rawValue: UInt(2))!  // I didn’t get a focus ring until I did this
              myLocalWindow.addSubview(myLocalText)
              myLocalWindow.documentView = myLocalText
  
              myLocalText.editable = true
              myLocalText.selectable = true
              myLocalText.verticallyResizable = true
  
              self.arrayOfFields.append(myLocalText)
  
          }
  </code></pre>
  
  <p>Routine that responds to clicking a button:</p>
  
  <pre><code>…
  
  view.makeFirstResponder(arrayOfFields[tag])  // THIS IS THE SUBJECT OF MY QUESTION
  
  // IT GIVES A COMPILER ERROR AS FOLLOWS: “Cannot invoke ‘makeFirstResponder’ with an argument list of type ’NSTextView’”
  // as far as I can tell from the documentation, makeFirstResponder should accept an argument type of NSResponder, and NSTextView should inherit from that
  </code></pre>