Yousef
Yousef

Reputation: 49

UITableView does not appear in simulator

I have build UItableView with static cells, when I tried to run it nothing is appear in my simulator,

here is my interface builder looks like:

enter image description here and here in simulator:

enter image description here

Upvotes: 1

Views: 492

Answers (2)

Pandurang Yachwad
Pandurang Yachwad

Reputation: 1723

You need to provide return value for number of sections and number of rows. By default it is 0

override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    // Return the number of sections.
    return 1   
}

override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

    // Return the number of rows in the section.

       return 3
}

Upvotes: 1

Lytic
Lytic

Reputation: 806

Make sure the tableview doesn't have a programatic datasource connected to your view controller, with the numberOfCells/numberOfSections/cellForRow methods overriding the static cell population

Upvotes: 0

Related Questions