1

我想同时将 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];...
4

1 回答 1

0

这个问题比我想象的要容易解决。我发现当你运行代码时

[[self restClient] loadRevisionsForFile:filename1 limit:10];

你正在传递的路径上。

解决方案:

- (void)restClient:(DBRestClient*)client loadedRevisions:(NSArray *)revisions forFile:(NSString *)path{ 

for (DBMetadata *file in revisions) 
{ 
if (segmentSwitch.selectedSegmentIndex == 0) { 


[[self restClient] path toRev:file.rev]; 

NSLog(@"MetaData's Revisions \t%@", file.rev); 

} 
}
于 2012-12-11T18:01:46.210 回答