没有在reloadRowsAtIndexPaths上调用Swift viewForHeaderInSection

时间:2015-09-01 09:43:14

标签: ios iphone uitableview reloaddata

我有一个UITableView有两个部分。当我尝试重新加载特定单元格时,部分标题不会被调用。这是我重新加载一个单元格的代码:

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        if tableView == self.pastEvalTableView{
            if indexPath.section == 0 && indexPath.row == 0{
                tableView.beginUpdates()
                var indexPathArray = NSMutableArray()
                indexPathArray.addObject(indexPath)
                self.pastEvalTableView.reloadSections(NSIndexSet(index: 2), withRowAnimation: UITableViewRowAnimation.None)
                tableView.endUpdates()
            }
        }
    }

当我在上面写viewForHeaderInSection行时,没有被调用。这是代码:

func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        if tableView == self.pastEvalTableView{
            var cell: Personcell = tableView.dequeueReusableCellWithIdentifier("personcell") as! Personcell
            return cell
        }
        return nil   
    }

0 个答案:

没有答案