Skip to content

Deleting object from cache

This method deleted an object from cache if it is present there.

- (void)removeWithKey:(NSString * _Nonnull)key responseHandler:^(void)responseHandler errorHandler:^(Fault * _Nonnull)errorHandler;
func remove(key: String, responseHandler: (() -> Void)!, errorHandler: ((Fault) -> Void)!)


Argument                Description
key identifies the object to delete from cache.


[Backendless.shared.cache removeWithKey:@"CacheWeather" responseHandler:^{
    NSLog(@"Object has been removed from cache");
} errorHandler:^(Fault *fault) {
    NSLog(@"Error: %@", fault.message);
Backendless.shared.cache.remove(key: "CacheWeather", responseHandler: {
    print("Object has been removed from cache")
}, errorHandler: { fault in
    print("Error: \(fault.message ?? "")")