Простой UITableView в Swift - неожиданно найден ноль

Довольно простой код:

func numberOfSectionsInTableView(tableView: UITableView?) -> Int {
    return 1
}

func tableView(tableView:UITableView!, numberOfRowsInSection section:Int) -> Int {
    return 5
}


func tableView(tableView:UITableView!, cellForRowAtIndexPath indexPath:NSIndexPath!) -> UITableViewCell! {
    let cell: BookTableViewCell = BookTableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "BookCell")
    println("ip: \(indexPath.row)")
    cell.bookLabel.text = "test"

    return cell
}

В строке cell.bookLabel.text я получаю это:

fatal error: unexpectedly found nil while unwrapping an Optional value

BookTableViewCell определяется следующим образом:

class BookTableViewCell: UITableViewCell {

    @IBOutlet var bookLabel: UILabel

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}

И bookLabel правильно подключен в ячейке Prototype в раскадровке. Почему я получаю эту ошибку?

Ответы на вопрос(10)

Ваш ответ на вопрос