How to Save PFFile to Object on iOS 9

250 views Asked by At

I get this problem upgrading to iOS 9, the Parse Framework doesn't work completely.

I'm not able to retrive PFFiles & I'm not able to save any PFobject that has PFFile inside it.

This is my Code that was working on iOS 8.3:

 -(void)Save{

......
        NSData *imageData = UIImageJPEGRepresentation(ProfilePicture.image, 0.5);
        NSString *filename = [NSString stringWithFormat:@"%@.jpg", usernameString];
        PFFile *imageFile = [PFFile fileWithName:filename data:imageData];
        [user setObject:imageFile forKey:@"ProfilePicture"];


        [user saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
            if (!error) {


                NSLog(@"Saved");
            }
            else{
                // Error
                NSLog(@"Error: %@ %@", error, [error userInfo]);
            }
        }];

}
0

There are 0 answers