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
-
urlKey –
URL string that refers to the base URL of the documents.
-
type –
type of the document to be stored. Refer to the Enum DocType.
-
error –
uninitialized error object filled in case of error scenarios.
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;
}