I'm using Parse as the backend for my app. In the User Class I have a pointer to an Album Class. I am trying to store that Album pointer value in a variable. I've tried declaring the variable as a PFObject, but I get the following error:
unrecognized selector sent to class
Code looks like this
This variable is declared above the class so it's available globally
var album = PFObject()
func getUserInfo() {
var currentUser = PFUser.currentUser()
let userQuery = PFQuery(className: "_User")
userQuery.whereKey("username", equalTo: PFUser.currentUser().username)
userQuery.includeKey("album")
userQuery.findObjectsInBackgroundWithBlock({ (results:[AnyObject]!, error:NSError!) -> Void in
if error == nil {
for result in results! {
album = result["album"] as PFObject
}
}
}
})
}
includeKey("Album")