从我的IOS应用程序上载DropBox上的图像

从我的IOS应用程序上载DropBox上的图像,ios,iphone,dropbox,dropbox-api,Ios,Iphone,Dropbox,Dropbox Api,我正在开发一个IOS应用程序,在这个应用程序中,我必须在DropBox上上传图像,但当我在iPhone模拟器上上传图像时,每次只上传5-6个图像,我遇到了连接超时-1005、网络错误-> 2014-06-10 11:42:53.283 PicBackMan_1[2602:60b] [WARNING] DropboxSDK: error making request to /1/metadata/dropbox/Photos - (404) Path '/Photos' not found 2

我正在开发一个IOS应用程序,在这个应用程序中,我必须在DropBox上上传图像,但当我在iPhone模拟器上上传图像时,每次只上传5-6个图像,我遇到了连接超时-1005、网络错误->

2014-06-10 11:42:53.283 PicBackMan_1[2602:60b] [WARNING] DropboxSDK: error making request to /1/metadata/dropbox/Photos - (404) Path '/Photos' not found  
2014-06-10 11:42:53.285 PicBackMan_1[2602:60b] restClient:loadMetadataFailedWithError: The operation couldn’t be completed. (dropbox.com error 404.)  
2014-06-10 11:42:55.167 PicBackMan_1[2602:60b] [WARNING] DropboxSDK: error making request to /1/files_put/dropbox/Super_12/PicBackMan-41.jpg - (-1005) Error Domain=NSURLErrorDomain Code=-1005 "The operation couldn’t be completed. (NSURLErrorDomain error -1005.)" UserInfo=0xa53b1d0 {destinationPath=/Super_12/PicBackMan-41.jpg, sourcePath=/Users/bettermac9/Library/Application Support/iPhone Simulator/7.1/Applications/F51F7F8F-91C5-4E67-90E6-4218941D3A67/Documents/image.jpg}
我收到了各种各样的错误。iPhone模拟器有什么问题吗?它在iPhone设备上正常工作吗? 请帮帮我

我在DropBox上上传图像的代码

- (void)_startUpload:(UIImage *)image
{
UIBackgroundTaskIdentifier bgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
    [[UIApplication sharedApplication] endBackgroundTask:bgTask];
    NSLog(@"%@",(NSString*)countere);
}];
// while(countere != 0){
HUD=[[MBProgressHUD alloc]initWithView:self.view];
[self.view addSubview:HUD];

HUD.labelText=@"Please wait for Uploading";
HUD.dimBackground=YES;
[HUD show:YES];

//NSString *fileString=@"/%@",albumNAME;
//  NSData * JPEGData = UIImageJPEGRepresentation(image, 1.0);
self.file = [NSString stringWithFormat:@"/%@",albumNAME];
NSLog(@"File Name ---> %@",self.file);
NSInteger randomNumber = arc4random() % 100;
NSString *filename = [NSString stringWithFormat:@"PicBackMan-%ld.jpg",(long)randomNumber];
NSArray *pathList = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
                                                        NSUserDomainMask,
                                                        YES);
countere--;
NSString *localPath = [[pathList objectAtIndex:0] stringByAppendingPathComponent:@"image.jpg"];;
NSLog(@"local Path ----> %@",localPath);
NSString *destDir = self.file;
count4++;
// [presenter presentHud:@"Uploading"];
[[self restClient] uploadFile:filename toPath:destDir
                withParentRev:nil fromPath:localPath];
if (count4%4==0) {
  [NSThread sleepForTimeInterval:2];
    NSLog(@"Background Thread Running");
}
//[NSThread sleepForTimeInterval:0.5];
[[UIApplication sharedApplication] endBackgroundTask:bgTask];
//   }
[self performSelectorOnMainThread:@selector(savingDone) withObject:nil waitUntilDone:YES];   
}

使用操作队列限制并发上载的数量。或者,使用NSURLSessionPloadTask,并在NSURLSessionConfiguration上设置HTTPMaximumConnectionsPerHost。

显示您正在使用的代码。不要试图同时上传超过4个请求…@wain:sir,这是我在DropBox上上传图像的代码->请花点时间格式化你的问题,使其可读…@wain抱歉我的错误,先生,因此,如果您遇到问题,请帮助我解决。我如何能够在用户的一次选择中上载5个以上的图像。谢谢您的帮助,我将使用这种方法。模拟器是否有任何问题,上载是否适用于iPhone设备?如果它在sim卡上不起作用,则通常在设备上不起作用。谢谢先生,我正在尝试修改上传错误。