0

ファイルのダウンロードを開始した後、ファイルのダウンロードを停止するにはどうすればよいですか?次のようにダウンロードを開始します。

[docDirSkyDRive  appendString:[NSString stringWithFormat:@"/%@ ",[[FilesFromSkyDrive objectAtIndex:indexPath] objectForKey:@"name"]]];
NSMutableString *downloadPath=[[NSMutableString alloc]init];
[downloadPath appendFormat:@"%@/content",[[FilesFromSkyDrive objectAtIndex:indexPath] objectForKey:@"id"]];
[self.liveClient downloadFromPath:downloadPath delegate:self userState:@"download"];

これはファイルをダウンロードするための私のコードスニペットですが、一度開始するとファイルのダウンロードを停止する方法がわかりません。

4

1 に答える 1

1

これをやってみてください

[docDirSkyDRive  appendString:[NSString stringWithFormat:@"/%@ ",[[FilesFromSkyDrive    objectAtIndex:indexPath] objectForKey:@"name"]]];
NSMutableString *downloadPath=[[NSMutableString alloc]init];
[downloadPath appendFormat:@"%@/content",[[FilesFromSkyDrive objectAtIndex:indexPath] objectForKey:@"id"]];
LiveOperation *opperation = [self.liveClient downloadFromPath:downloadPath delegate:self userState:@"download"];

その後、次を使用してこの操作をキャンセルできます[opperation cancel];

于 2014-03-12T09:50:17.757 に答える