当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - Request body stream exhausted when using Parse's saveInBackgroundWithBlock:

问题描述:

The problem only happens when I have using mobile data to upload photo to Parse that I will get "Upload Failure - Request Body Stream exhausted" error. That means if my phone is using WiFi mode, everything goes smooth.

Anyone could help me to solve the problem?

Thanks,

Kenny

My code for saving image is attached 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];

}

}];

分享给朋友:
您可能感兴趣的文章:
随机阅读: