我想同时将 3 个文件恢复到之前的版本。使用您在下面看到的方法,适用于 1 个文件,但不适用于 3:
我打电话:
[[self restClient] loadRevisionsForFile:filename3 limit:10];
进而:
- (void)restClient:(DBRestClient*)client loadedRevisions:(NSArray *)revisions forFile:(NSString *)path{
for (DBMetadata *file in revisions)
{
if (segmentSwitch.selectedSegmentIndex == 0) {
NSString *title = [[NSUserDefaults standardUserDefaults]objectForKey:@"Folder3"];
PhotoViewController* sharedSingleton = [PhotoViewController sharedManager];
NSString *destDir = [[NSUserDefaults standardUserDefaults]objectForKey:@"Folder2"];
NSString *filename3 = [NSString stringWithFormat:@"%@%@photofile.png.%ld", destDir, title, (long)sharedSingleton.tagNumber];
[[self restClient] restoreFile:filename3 toRev:file.rev];
[[self restClient] restoreFile:filename4 toRev:file.rev];
[[self restClient] restoreFile:filename5 toRev:file.rev];
NSLog(@"MetaData's Revisions \t%@", file.rev);
}
}
我必须这样做:
[[self restClient] loadRevisionsForFile:filename1 limit:10];, [[self restClient] loadRevisionsForFile:filename2 limit:10];...