I have a class of users in Parse named "User".
I set a PFRelation of user with other users like this :
let relation : PFRelation = currentUser.relationForKey("KfriendsRelation")
Lets say i have user 1, i can retrieve all users that this particular user follow with this :
if let friendsRelation: AnyObject! = userPassed.objectForKey("KfriendsRelation") {
println(friendsRelation)
if friendsRelation != nil {
let findUser : PFQuery = friendsRelation.query()
findUser.whereKey("objectId", notEqualTo: PFUser.currentUser().objectId)
findUser.findObjectsInBackgroundWithBlock....
What should i do if i want to retrieve all users that follow user 1 ?
I made this but it doesn't work :
let findUser : PFQuery = PFUser.query()
findUser.whereKey("kfriendsRelation", equalTo: user 1)
findUser.findObjectsInBackgroundWithBlock { (objects:[AnyObject]!, error:NSError!) -> Void in
if !(error != nil) {
// The find succeeded.
println("succesfull load Users in FollowingTableView")
println(objects.count)
// Do something with the found objects
for object in objects {
self.followingUserList.addObject(object)
println(object)
}
self.tableView.reloadData()
} else {
// Log details of the failure
println("error loadind user ")
println("error")
}
} }
It print me "succesfull load Users in FollowingTableView" but println(object.count) print me "0". I am sure there are objects so i m confused...