title: Caught NSInternalInconsistencyException request for rect at invalid indexPath
body: <p>The following line crashes the program:</p>
  
  <pre><code>let cell = tableView.dequeueReusableCellWithIdentifier("ItemCell", forIndexPath: NSIndexPath(forRow: 0, inSection: 0)) as! ItemCell
  </code></pre>
  
  <p>The console log shows the following error: </p>
  
  <pre><code>"caught "NSInternalInconsistencyException", "request for rect at invalid index path (&lt;NSIndexPath: 0xc000000000000016&gt; {length = 2, path = 0 - 0})"
  </code></pre>
  
  <p>Here is a bullet point list of things I've checked:</p>
  
  <ul>
  <li>Correct Storyboard ID is listed in the identity inspector</li>
  <li>Correct custom class is listed in the identity inspector</li>
  <li>Attributes inspector has "ItemCell" in the Table View Cell identifier field</li>
  </ul>
  
  <p>Here is the full code:</p>
  
  <pre><code>import XCTest
  @testable import ToDo
  
  class ItemCellTests: XCTestCase {
  
      override func setUp() {
          super.setUp()
          // Put setup code here. This method is called before the invocation of each test method in the class.
      }
  
      override func tearDown() {
          // Put teardown code here. This method is called after the invocation of each test method in the class.
          super.tearDown()
      }
  
      func testSUT_HasNameLabel(){
  
          let storyboard = UIStoryboard(name: "Main", bundle: nil)
          let controller = storyboard.instantiateViewControllerWithIdentifier("ItemListViewController") as! ItemListViewController
  
          _=controller.view
  
          let tableView = controller.tableView
          tableView.dataSource = FakeDataSource()
  
          let cell = tableView.dequeueReusableCellWithIdentifier("ItemCell", forIndexPath: NSIndexPath(forRow: 0, inSection: 0)) as! ItemCell
  
  
          XCTAssertNotNil(cell.titleLabel)
      }
  }
  
  
  extension ItemCellTests{
      class FakeDataSource: NSObject, UITableViewDataSource {
          func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
              return 1
          }
  
          func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
              return UITableViewCell()
          }
      }
  }
  </code></pre>
  
  <p>Here is the ItemCell.swift code:</p>
  
  <pre><code>import UIKit
  
  class ItemCell: UITableViewCell {
  
      @IBOutlet weak var titleLabel: UILabel!
  
  
      func configCellWithItem(item: ToDoItem){
  
      }
  }
  </code></pre>
  
  <p>All properties that are tied to the storyboard are connected.  What is being overlooked?</p>