I'm trying to populate tableview with parse with 2 labels connected to the the main tv controller with PFTableViewCell
when I add the (numberOfSectionsInTableView + numberOfRowsInSection ) the app crash
but when I deleted it it works but it show nothing.
This the table view cell
class courseCell: PFTableViewCell { @IBOutlet var name: UILabel! @IBOutlet var location: UILabel! }
This the table view controller
class courseTVC: PFQueryTableViewController { override init!(style: UITableViewStyle, className: String!) { super.init(style: style, className: className) } required init(coder aDecoder:NSCoder) { super.init(coder:aDecoder) self.parseClassName = "courses" self.textKey = "Location" self.pullToRefreshEnabled = true self.paginationEnabled = false } override func queryForTable() -> PFQuery! { var query = PFQuery(className: "courses") query.orderByDescending("Location") return query } override func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 4 } override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!, object: PFObject!) -> PFTableViewCell { var cell = tableView.dequeueReusableCellWithIdentifier("cell" , forIndexPath : indexPath) as? courseCell if cell == nil { cell = courseCell(style: UITableViewCellStyle.Default, reuseIdentifier: "cell") } cell!.name.text = object["Price"] as! String! cell!.location.text = object["Location"] as! String! return cell! }
I don't know how to fix this issue