I'm trying to save an image to parse.com with the following code:
NSData *imageData = UIImagePNGRepresentation(profileImage);
PFFile *imageFile = [PFFile fileWithName:@"Profileimage.png" data:imageData];
[imageFile saveInBackground];
PFUser *user = [PFUser currentUser];
user[@"fullName"] = name;
user[@"Location"] = location;
user[@"gender"] = gender;
user[@"email"] = email;
user[@"ProfilePic"] = imageFile;
[user saveInBackground];
The problem is that this doesn't seem to be saving the image file to parse as nothing is populated in my data browser. The code here looks fine to me, but can you guys see anything wrong with it?
The image is being downloaded from Facebook with the following code:
NSURL *pictureURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?type=large&return_ssl_resources=1", facebookID]];
NSData *data = [[NSData alloc] initWithContentsOfURL:pictureURL];
UIImage *profileImage = [[UIImage alloc] initWithData:data];
Any ideas?
Thanks