我有一个.xib文件,我希望它是一个表视图控制器,但是当我在.xib文件中创建一个表视图控制器时,我得到错误表视图包含嵌入的部分和单元格仅在故事板文档中受支持.我该如何解决.下面是我的实际表视图的代码.
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 }