readDocumentForUrlKey:forDocType:withError: method

Reads the service document or the meta data document for further reuse since they are the base on which data parsing can be performed.

Syntax

- ( id ) readDocumentForUrlKey : ( NSString * ) urlKey forDocType : ( DocType ) type withError : ( NSError ** ) error

Parameters

Returns

document object that is cached.
 id<Caching> cacheLocal = [[Cache alloc] init];
 NSError* error = nil;
 id document = [cacheLocal readDocumentForUrlKey:urlKey forDocType:ServiceDocumentType withError:&error];
 if (error) {
     NSLog("Read Document Error : %@", error);
     return;
 }