replaceWithDocument()

Description

Replaces the data at the specified index of the buffer with the specified DcsDocument.

Syntax

- (void) replaceWithDocument: (DcsDocument *) document
index: (NSInteger) index

Parameters

document:DcsDocument The document to be added to the buffer.
index:NSInteger The specified index of the document to be replaced.

Return value

Void

Exceptions

Circumstance Exception thrown
Document is nil. DcsValueNotValidException
Document is not DcsImage. DcsTypeNotValidException
The index is not a positive value or it equals / is larger than count. DcsValueOutOfRangeException

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];


    UIImage *Rimg = [UIImage imageNamed:@"barcode"];
    DcsDocument *DcsRDoc = [[DcsDocument alloc]init:Rimg];
    [self.dcsView.buffer replaceWithDocument:DcsRDoc index:1];
}

@end