FWCacheProtocol

@protocol FWCacheProtocol <NSObject>

缓存调用协议

  • 读取某个缓存

    Declaration

    Objective-C

    - (nullable id)objectForKey:(nonnull NSString *)key;
  • 设置某个缓存

    Declaration

    Objective-C

    - (void)setObject:(nullable id)object forKey:(nonnull NSString *)key;
  • 设置某个缓存,支持缓存有效期,小于等于0为永久有效

    Declaration

    Objective-C

    - (void)setObject:(nullable id)object
               forKey:(nonnull NSString *)key
           withExpire:(NSTimeInterval)expire;
  • 移除某个缓存

    Declaration

    Objective-C

    - (void)removeObjectForKey:(nonnull NSString *)key;
  • 清空所有缓存

    Declaration

    Objective-C

    - (void)removeAllObjects;