Request body stream exhausted when using Parse saveInBackgroundWithBlock:

The problem only occurs if I have mobile info to upload a photo to Parse and I get the error "Fault tolerance - Body Stream request exhausted". This means that if my phone is using WiFi mode, everything runs smoothly.

Can anyone help me solve the problem?

Thanks, Kenny

My code for saving the image is below:

self.pfProfile[@"logo"] = imageFile;


// Upload Profile to Parse
[self.pfProfile saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
    [indicator stopAnimating];
    if (succeeded) {
        NSLog(@"Update Profile Successfully");
        // Notify table view to reload the recipes from Parse cloud
        //[[NSNotificationCenter defaultCenter] postNotificationName:@"refreshTable" object:self];
    } else {
        UIAlertController *alertController = [UIAlertController
                                              alertControllerWithTitle:@"Upload Failure" message:[error localizedDescription]
                                              preferredStyle:UIAlertControllerStyleAlert];
        UIAlertAction *okayAction = [UIAlertAction actionWithTitle:@"OK"
                                                             style:UIAlertActionStyleDefault handler:nil];
        [alertController addAction:okayAction];
        [self presentViewController:alertController animated:YES completion:nil];
    }
}];

      

+3


source to share





All Articles