【发布时间】:2016-12-23 14:35:07
【问题描述】:
我在将图像上传到 Parse 时遇到问题。直到昨天一切都很好。我的应用程序还没有上线,我只是在测试,图像大约 25kb,它只是用于用户个人资料图片的单个图像。代码是:
//Save the image
NSData *imageData = UIImageJPEGRepresentation(image, 1);
PFFile *imageFile = [PFFile fileWithName:@"profile.jpg" data:imageData];
[imageFile saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if(succeeded){
[userBank setObject:imageFile forKey:@"profilePic"];
[userBank saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if(succeeded){
NSLog(@"save done");
userBank = [PFUser currentUser];
user[@"profilePic"] = imageFile;
[userBank saveInBackground];
}
else{
NSLog(@"%@", error);
handler(NO,YES,nil);
}
}];
}
else{
NSLog(@"image not saved %@",error);
handler(NO,YES,nil);
}
}];//End save image block
我突然收到此错误:请求主体流已耗尽,NSUnderlyingError=0x17ece150 "请求主体流已耗尽"。有没有人遇到过这种情况,可以给我一些关于这里可能发生的事情的指示?
【问题讨论】:
-
你在哪一行得到这个错误?
-
最后的 else,用于将图像保存到 Parse.com 服务器
-
我认为你做错了,但我不确定,让我检查一下文档
-
您确定您的互联网连接良好并且解析正常运行吗?老实说,我从未见过此错误,但其他帖子表明这更像是一个滞后问题。 :l
-
我认为是 Parse。大约 30 分钟后再次开始工作。
标签: ios objective-c parse-platform