我正在使用 Parse 中的部分和分页实现 PFQueryTableViewController。因为我使用的是部分,所以我需要自己设置“加载更多”单元格。但是,我似乎无法访问方法 cellForNextPageAtIndexPath - 我收到一个错误: ''UITablView' does not have a member name 'cellForNextPageAtIndexPath' ' 。
我环顾四周,关于这个主题的唯一资源似乎是这个未回答的问题:cellForNextPageAtIndexPath in swift
这是我的代码:
override func tableView(tableView: UITableView, cellForNextPageAtIndexPath indexPath: NSIndexPath) -> PFTableViewCell? {
return PFTableViewCell()
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject!) -> PFTableViewCell? {
let objectId = objectIdForSection((indexPath.section))
let rowIndecesInSection = sections[objectId]!
let cellType = rowIndecesInSection[(indexPath.row)].cellType
var cell : PFTableViewCell
if (indexPath.section == self.objects?.count) {
cell = tableView.cellForNextPageAtIndexPath(indexPath) //'UITablView' does not have a member name 'cellForNextPageAtIndexPath'
}
switch cellType {
case "ImageCell" :
cell = setupImageCell(objectId, indexPath: indexPath, identifier: cellType)
case "PostTextCell" :
//cell = setupImageCell(objectId, indexPath: indexPath, identifier: "ImageCell")
cell = setupTextCell(objectId, indexPath: indexPath, identifier: cellType)
case "CommentsCell" :
cell = setupCommentsCell(objectId, indexPath: indexPath, identifier: cellType)
case "UpvoteCell" :
cell = setupUpvoteCell(objectId, indexPath: indexPath, identifier: cellType)
case "DividerCell" :
cell = setupDividerCell(indexPath, identifier: cellType)
default : print("unrecognised cell type")
cell = PFTableViewCell()
}
cell.selectionStyle = UITableViewCellSelectionStyle.None
return cell
}