0
我有第二个控制器的一些问题的tableView使用的tableView在prepareForSegue迅速
第一控制器的代码:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "DetailSegue" {
let detailViewController = segue.destinationViewController as DetailViewController
let indexPath = self.liveMatch!.indexPathForSelectedRow()!
}
}
第二个控制器的代码:(DetailViewController)
import UIKit
class DetailViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// Return the number of rows in the section.
return 5
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("playersCell", forIndexPath: indexPath) as PlayersTableViewCell
cell.playerName.text = "test"
return cell
}
}
以秒控制器表是空的;(我如何修复这个?谢谢你!
返回错误:方法不覆盖从超类的任何方法 – 2015-03-19 09:56:12
对不起,override关键字是没有必要在这种情况下。只有在使用UITableViewController时才是必需的。删除它,它应该工作。 – 2015-03-19 10:07:56
尝试过。结果没有改变:返回空列。 – 2015-03-19 10:11:05