Last active
August 29, 2015 14:20
-
-
Save oscarmorrison/80a448f266d89508bd6f to your computer and use it in GitHub Desktop.
Parse objects from PFQuery and Store only objects != current user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var usernames = [PFUser]() | |
var currentUser = PFUser.currentUser() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
var query = PFUser.query() | |
query?.findObjectsInBackgroundWithBlock({ (objects, error: NSError?) -> Void in | |
if error == nil{ | |
for username in objects as Array!{ | |
if(self.currentUser?.objectId != username.objectId){ | |
self.usernames.append(username as! PFUser) | |
} | |
} | |
self.tableView.reloadData() | |
}else{ println("error could not get usernames")} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment