In my ViewController, i have an UITableView and these methods :
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if(self.mQuoteObjects.count > 0){
return 1
}
return 0
}
func tableView(tableView: UITableView, numberOfSectionsInTableView section: Int) -> Int {
let nbItem = self.mQuoteObjects.count
return nbItem
}
Method "numberOfRowsInSection" is correctly called, but "numberOfSectionsInTableView" is never called.
What have i missed?
You can respond in Obj-c
The name of the method is not correct. It should be numberOfSectionsInTableView(_:)
.
See the UITableViewDataSource protocol reference.
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return self.mQuoteObjects.count
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With