RBPrecalculatedDataPersistentCache Class Reference

Inherits from NSObject
Declared in RBPrecalculatedDataPersistentCache.h

Overview

Stores the result of a calculation, recalculating when invalidated.

  storageKey

The unique storage key determining where the precalculated data is stored.

@property (nonatomic, readonly, nonnull) NSString *storageKey

Discussion

The unique storage key determining where the precalculated data is stored.

Declared In

RBPrecalculatedDataPersistentCache.h

– initWithStorageKey:recalculationBlock:

Initializes a new calculated data persistent cache with the given settings.

- (nonnull instancetype)initWithStorageKey:(nonnull NSString *)storageKey recalculationBlock:(nonnull NSData *__nullable ( ^ ) ( ))recalculationBlock

Parameters

storageKey

The unique storage key to use when saving and loading precalculated data.

recalculationBlock

The block to call to recalculate the data.

Return Value

The initialized object.

Discussion

Initializes a new calculated data persistent cache with the given settings.

Declared In

RBPrecalculatedDataPersistentCache.h

– invalidate

Invalidates the data causing a recalculation before the next retrieval.

- (void)invalidate

Discussion

Invalidates the data causing a recalculation before the next retrieval.

Declared In

RBPrecalculatedDataPersistentCache.h

– retrieveData

Retrieve the most recently calculated data.

- (nullable NSData *)retrieveData

Return Value

An NSData object.

Discussion

Retrieve the most recently calculated data.

Declared In

RBPrecalculatedDataPersistentCache.h