シンプルな .csv ファイルを Dropbox にアップロードするアプリがあります。ファイルは送信時に完全にアップロードされますが、restClient UploadFile メソッドは呼び出されません。これを使用して、ファイルが正常にアップロードされたことをユーザーに表示したいと思います。コードを実行した最初の数回は呼び出されたのを覚えているようですが、その後停止し、理由がわかりません。
ここにいくつかのスニペットがあります:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0) //Cancel
{
}
else if (buttonIndex == 1) //Send
{
NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *CCD = [docPath stringByAppendingPathComponent:@"CCD.csv"];
if ([[NSFileManager defaultManager] fileExistsAtPath:CCD])
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *machineName = [defaults objectForKey:@"machineName"];
NSString *fileTitle = [defaults stringForKey:@"setTitle"];
NSMutableString *filePath = [NSMutableString string];
[filePath appendString:docPath];
[filePath appendString:@"/CCD.csv"];
NSString *destDir = @"/";
[SVProgressHUD showWithStatus:[NSString stringWithFormat:@"Sending to %@...", machineName]];
[[self restClient] uploadFile:fileTitle toPath:destDir
withParentRev:nil fromPath:filePath];
}
}
}
- (void)restClient:(DBRestClient*)restClient uploadedFile:(NSString*)filePath {
NSLog(@"File uploaded successfully");
[SVProgressHUD dismiss];
};
私が言ったように、それはファイルを完全にアップロードしますが、uploadedFile メソッドへの呼び出しを取得しません。