Я реализую PFQueryTableViewController из Parse с разделами и разбиением на страницы. Поскольку я использую разделы, мне нужно установить ячейку «загрузить больше» самостоятельно. Однако, похоже, что я не могу получить доступ к методу cellForNextPageAtIndexPath - я получаю сообщение об ошибке: «UITablView» не имеет имени участника «cellForNextPageAtIndexPath».cellForNextPageAtIndexPath не видно в swift2
Я посмотрел вокруг и единственный ресурс, на эту тему, кажется, этот вопрос без ответа: 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
}