get()

Description

Gets the image or document with the specified index in the buffer.

Syntax

- (id) get: (NSInteger) index

Parameters

index:NSInteger Specifies the index of an image or a document. The index is 0-based.

Return value

id

The image or document with the specified index in the buffer. If the type of the data with the specified index is DcsImage, the method will return a DcsImage object. If it is DcsDocument, the method will return a DcsDocument object.

Remarks

If the index is not a positive value, or it equals/is larger than count, the exception DcsValueOutOfRangeException will be thrown and nil will be returned.

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


    if([self.dcsView.buffer get:0] != nil){
        DcsImage *tempImg = [self.dcsView.buffer get:0];
        [self.dcsView.buffer appendImage: tempImg];
    }
}

@end