I'm trying to upload a photo to Parse and I am getting a strange error.
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<PFQuery 0xbe68310> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key profilePic.'
I can't figure out why this is happening though. Heres the code.
- (IBAction)setProfilePressed:(id)sender {
PFQuery *query = [PFQuery queryWithClassName:@"Cards"];
[query whereKey:@"name" containsString:[[PFUser currentUser] objectForKey:@"name"]];
UIImage *image = [UIImage imageNamed:@"male_user_icon.png"];
NSData *imageData = UIImagePNGRepresentation(image);
PFFile *imageFile = [PFFile fileWithName:@"male_user_icon.png" data:imageData];
[imageFile saveInBackground];
[query setValue:imageFile forKey:@"profilePic"];
}
The profilePic type is set to "File" and I am uploading a PFFile so i don't understand what the problem is. Let me know if you need any more information.