我从解析实现PFQueryTableViewController与部分和分页。 因为我使用的部分,我需要设置“负载更多的”细胞对我自己的。 然而,看来我无法访问方法cellForNextPageAtIndexPath - 我得到一个错误:“” UITablView“没有一个会员名“cellForNextPageAtIndexPath”。
我环顾四周,并在主题的唯一资源似乎是这个悬而未决的问题: cellForNextPageAtIndexPath在迅速
这里是我的代码:
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
}