save()

Description

Saves all the images and documents in DcsBuffer to a folder named dirName.

Syntax

- (void) save: (NSString *) dirName

Parameters

dirName:NSString The name of the folder to save files.

Return value

Void

Remarks

The data in Buffer is temporarily stored in the memory. Once the app is closed, it will be cleared. Using this function will make the data persisted in the buffer. Users can recover it to Buffer using load function.
If the folder dirName doesn't exist, it will be created automatically. If it exists and there are image and document data stored in it, all the data will be cleared and the new data will be saved.
If dirName is nil or '', the exception DcsValueNotValidException will be thrown.

Example


@interface ViewController () {
    DcsView *dcsView;
}
@end
 
@implementation ViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
     
    dcsView = [[DcsView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
 
    [self.view addSubview:dcsView];

    NSString *Path = NSTemporaryDirectory();
    Path = [Path stringByAppendingString:@"DCSSaveFolder"];
    NSLog(@"path: %@",Path);
    [self.dcsView.buffer save:Path];
}

@end