UITableView单元格重复第一个单元格

UITableView单元格重复第一个单元格,uitableview,swift,Uitableview,Swift,我的TableView一直在重复第一个单元格,我很难找出问题所在。我在这里搜索了一下,找到了一条相关的线索 我发现问题在于我没有在CellForRowatineXpath方法中指定节。我知道我必须在代码中实现indexPath.section,但我不知道如何/在哪里实现 非常感谢您的帮助 override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UI

我的TableView一直在重复第一个单元格,我很难找出问题所在。我在这里搜索了一下,找到了一条相关的线索

我发现问题在于我没有在CellForRowatineXpath方法中指定节。我知道我必须在代码中实现indexPath.section,但我不知道如何/在哪里实现

非常感谢您的帮助

   override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
    let cellIdentifier = "Cell"
    let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath:indexPath) as CustomTableViewCell

    // Configure the cell...
    let entry = entries[indexPath.row]
    cell.entryTextView!.text = entry.bodyText
    cell.entryDayLabel!.text = entry.day
    cell.entryDateLabel!.text = entry.date

    return cell
}

您的entries数组如何划分为节?@rakeshbs如下:entries=fetchedResultsController.FetchedObject为[Entry]@rakeshbs,遵循以下代码:fetchedResultsController=NSFetchedResultsController fetchRequest:fetchRequest,managedObjectContext:managedObjectContext,sectionNameKeyPath:section,cacheName:nil