我用swift开发一个ios应用程序。我使用解析作为后端
我有2节课
class has(Name,Owner>指向_user类的指针)
member(member_user>指向注册该类的用户的指针,ObjectId>指向类的指针)
我想获得会员注册的课程。我能够检索确切的类,但问题是我没有得到单元格中显示的类的名称
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.parseClassName = "class"
self.textKey = "Name"
self.pullToRefreshEnabled = true
self.paginationEnabled = true
self.objectsPerPage = 20
}
override func queryForTable() -> PFQuery! {
var query1 = PFQuery(className: "class")
//query1.whereKey("member_user", equalTo: PFUser.currentUser())
var query2 = PFQuery(className: "MEMBER")
query2.whereKey("member_user", equalTo: PFUser.currentUser())
query2.whereKey("ObjectId", matchesKey: "objectId", inQuery: query1)
return query2}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject) -> PFTableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("Cell") as PFTableViewCell!
cell.backgroundColor = UIColor.clearColor()
if cell == nil {
cell = PFTableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell")
}
cell.textLabel?.text =
object["Name"] as String!
return cell
}