title: -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance
body: <p>I am very new to Swift as I justed started on it only a few months back. I have an aching problem with this error. </p>
  
  <pre><code>-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance XXX
  </code></pre>
  
  <p>Here is a list of possible fixes that I have so far gathered and implemented already.</p>
  
  <ol>
  <li>I have changed the Custom Class to <code>CheckboxQuestion</code> class instead of the <code>UIViewController</code> class.  </li>
  </ol>
  
  <p><a href="http://i.stack.imgur.com/XCxDC.png" rel="nofollow">Custom Class</a></p>
  
  <ol start="2">
  <li><p>I have connected the tableview to the datasource and delegate.</p></li>
  <li><p>I have accounted for all loose referencing outlets.</p></li>
  <li><p>I have named the reusable identifier outlet for each prototype cell.</p></li>
  </ol>
  
  <p><a href="http://i.stack.imgur.com/uz3Q2.png" rel="nofollow">prototype cell 1</a></p>
  
  <p>After all those, I am still getting the error above.</p>
  
  <p>The breakpoint of the exception error happened in the appdelegate class at this line</p>
  
  <pre><code>class AppDelegate: UIResponder, UIApplicationDelegate {
  </code></pre>
  
  <p>Is there something else which I am missing?</p>
  
  <p>Here is the code for CheckboxQuestion Class code</p>
  
  <pre><code>import UIKit
  
  var checkboxCellInfo = ["Field 1", "Field 2"]
  
  class CheckboxQuestion: UIViewController {
  
  @IBOutlet weak var tableView: UITableView!
  
  //1. determine number of rows of cells to show data
  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {  
      return checkboxCellInfo.count + 1
  }
  
  //2. inputs info into each cell from array 'cellInfo'
  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell? {
  
      if indexPath.row &lt;= checkboxCellInfo.count - 1 {
  
          let cell:CheckboxQuestionCellConnect = self.tableView.dequeueReusableCellWithIdentifier("CheckboxNumber") as! CheckboxQuestionCellConnect
  
          return cell 
  
       } else {
  
          let cell:CheckboxQuestionCellConnect = self.tableView.dequeueReusableCellWithIdentifier("CheckboxAdd") as! CheckboxQuestionCellConnect
  
          return cell
  
      }  
  }
  
  //3. determines height of each cell
  func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -&gt; CGFloat {
      return 60
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  }
  </code></pre>