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

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.

Declared In

RBPrecalculatedDataPersistentCache.h

– invalidate

Invalidates the data causing a recalculation before the next retrieval.

- (void)invalidate

Declared In

RBPrecalculatedDataPersistentCache.h

– retrieveData

Retrieve the most recently calculated data.

- (nullable NSData *)retrieveData

Return Value

An NSData object.

Declared In

RBPrecalculatedDataPersistentCache.h