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


- (void) save: (NSString *) dirName


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

Return value



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.


@interface ViewController () {
    DcsView *dcsView;
@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];


Is this page helpful?

Leave a Reply

Your email address will not be published.