Я пытаюсь подсчитать количество найденных объектов в PFQueryTableViewController
.Подсчет найденных объектов в PFTableQueryViewController
Я попытался работать вокруг с
override func queryForTable() -> PFQuery {
let query = PFQuery(className: self.parseClassName!)
query.whereKey("member", equalTo: memberId!)
let count = query.countObjectsInBackground()
label.text = "\(count)"
return query
}
Но мое приложение потерпит крах.
EDIT: Проблема заключается не в том, чтобы делать запрос и считать его объекты. Проблема заключается в том, чтобы использовать queryForTable
передавая мой запрос к cellForRowAtIndexPath
моего PFQueryTableViewController
cellForRowAtIndexPath
выглядит следующим образом:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject?) -> PFTableViewCell? {
let cell:DetailApplicantCell = self.table.dequeueReusableCellWithIdentifier("reuseIdentifier") as! DetailApplicantCell
if let name = object?.objectForKey(self.textKey!) as? String{
cell.nameLbl.text = name
}
cell.groupImage.image = UIImage(named: "People.png")
if let imageFile = object?.objectForKey(self.imageKey!) as? PFFile{
cell.groupImage.file = imageFile
cell.groupImage.loadInBackground()
}
return cell
}
Обратите внимание, что это не cellForRow по умолчанию
Где он падает и что такое журнал аварий? – Santosh