Stores the service document or the meta data document for further reuse since they are the base on which data parsing can be performed.
Syntax
-
(
BOOL
)
storeDocument
:
(
id
)
document
forDocType
:
(
DocType
)
type
forUrlKey
:
(
NSString *
)
urlKey
withError
:
(
NSError **
)
error
Parameters
-
document –
document object to be cached.
-
type –
type of the document to be stored. Refer to the Enum DocType.
-
urlKey –
URL string that refers to the base URL of the documents.
-
error –
uninitialized error objectfilled in case of error scenarios.
Returns
Boolean to indicate the outcome of the operation.
id<Caching> cacheLocal = [[Cache alloc] init];
NSError* error = nil;
if ([cacheLocal storeDocument:servDoc forDocType:ServiceDocumentType forUrlKey:urlKey withError:&error]) {
NSLog("Store Document Error : %@", error);
return;
}