I have a .xib file and I want it to be a table view controller, but when I create a table view controller in a .xib file, I get the error Table views with embedded sections and cells are only supported in storyboard documents . How to fix it. Below is my code for the actual presentation of the table.
self.add = [Play(name: title!), Play(name: artist!), Play(name: album!)] override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.add.count //return count of objects in array } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = self.tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell var play: Play play = add[indexPath.row] cell.textLabel?.text = play.name return cell }
ios swift
blee
source share