You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below works well if the user had signed up and didn't log out yet.
But if the user logs out and then logs in again, it throws the following error: [Error]: Can't download a file that doesn't exist on the server or locally. (Code: 151, Version: 1.12.0)
Apparently, login function is not retrieving extra file fields properly:
if let user = PFUser.currentUser() {
if let photo = user["profilePhoto"] as? PFFile {
photo.getDataInBackgroundWithBlock({ (data: NSData?, error: NSError?) -> Void in
dispatch_async(dispatch_get_main_queue(), {
if let data = data {
self.profileImageView.image = UIImage(data: data)
}
})
})
}
}