I'm using Tableview controller to make two prototype cells that app crash due to
thread 1 exc_bad_instruction (code=exc_i386_invop subcode=0x0) pointed to >>> return cell! in the first cell
fatal error: unexpectedly found nil while unwrapping an Optional value
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 10
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
if (indexPath.section == 0) {
let cell = tableView.dequeueReusableCellWithIdentifier("one", forIndexPath: indexPath) as? one
cell?.textLabel?.text = "book"
return cell!
} else {
let cell = tableView.dequeueReusableCellWithIdentifier("two", forIndexPath: indexPath) as! two
cell.textLabel?.text = "not a book"
return cell
}