I have a PFObject ("Task") which contains keys ("taskCreatorEmail") of type string, and ("taskAssignedTo") of type array. ("taskAssignedTo") stores an array of objects. The objects consists of "name" and "email" key/value pairs.
How can I retrieve all unique Assignee "name" values created by a specified creator?
Note: I'm using PFQueryTableViewController, so the query I use to retrieve data is:
func baseQuery() -> PFQuery {
var query = PFQuery(className: "Task")
let userDetails = Authentication().getUserDetails()
query.whereKey("taskCreatorEmail", equalTo: userDetails.email)
query.orderByAscending("updatedAt")
return query
}
The goal is to populate the tableView cells with the Assignee Names.
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject?) -> PFTableViewCell? {
var cell = tableView.dequeueReusableCellWithIdentifier("TaskGroupsCell") as! PFTableViewCell!
if cell == nil {
cell = PFTableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "TaskGroupsCell")
}
let assignees = object?["taskAssignedTo"] as! NSArray
for object in assignees {
}
return cell
}