ios - How do I fix the illegal configuration? -
i have .xib file , want table view controller, when create table view controller in .xib file error table views embedded sections , cells supported in storyboard documents
. how fix this. below code actual table view.
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 }
xibs sort of out dated, , when invented, didnt have prototype cells make in ui builder. when storyboards introduced functionality made well, except not ported xib editor, cant use prototype cells in xib unfortunately, need make separate xibs cells layout.
Comments
Post a Comment