I have declared a variable called restaurantNames
and used an array to store the table data. When I run my program, I get an error Thread 1: Break point 1.3
but there's no highlighted errors on my code and also the TableView doesn't show the lines between rows it's just a blank page.
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
var restaurantNames = ["Lucky WOK", "JFK", "Cafe11"]
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// return the number of rows in the section
return restaurantNames.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cellIndentifier = "Cell"
let cell = tableView.dequeueReusableCellWithIdentifier(cellIndentifier, forIndexPath: indexPath)
// Configure the cell
cell.textLabel?.text = restaurantNames [ indexPath.row]
return cell
}
Output of the console:
UIKit-3512.29.5/UITableView.m:6547
2015-12-16 01:37:50.392 Dine-In[35796:238637] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'