在 Swift 2 中从 segue 展开后 Tableview 未重新加载

Tableview not reloading after unwind from segue in Swift 2

我有一个工作 table 从声明为

的数组填充数据
var tableData:[AnyObject] = []

这里是展开函数

@IBAction func unwindToVC(segue: UIStoryboardSegue) {
        if(segue.sourceViewController .isKindOfClass(AddNewsViewController))
        {
            let data:AddNewsViewController = segue.sourceViewController as! AddNewsViewController
            let newscontent = data.contentView.text
            let newstitle = data.contentView.text
            let author = data.contentView.author
            let dateposted = data.contentView.dateposted
            let icon = data.contentView.icon
            let location = data.contentView.location
            let description = data.contentView.description

            self.tableData.append(
                [
                    "title":newstitle,
                    "author":author,
                    "dateposted":date,
                    "icon":envelope,
                    "location":location,
                    "description":description
                ]
            )
            self.newsTable.reloadData()
            print(self.tableData)
        }
    }

日志 returns 包含最近附加数据的数组,但 table 视图没有重新加载新的详细信息。

viewDidAppear 而不是 unwindToVC 中调用 newsTable.reloadData()。根据Apple:

For efficiency, the table view redisplays only those rows that are visible.

当调用 unwindToVC 时,none 行仍然可见。