如何清除目标C中的应用程序缓存? [英] How to clear cache of app in objective C?

查看:113
本文介绍了如何清除目标C中的应用程序缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个iOS应用,其中我已经实现了Fabric并使用Digits进行登录.登录成功后,会话将保持打开状态.

I'm building an iOS app in which i have implemented Fabric and using Digits for login.When login is successful session remains open.

我遇到一个问题,我想清除应用程序缓存以重置会话,以便用户可以使用新的电话号码再次登录.

I'm facing an issue i want to clear the app cache to reset the session so user can login again with a new phone number.But it is not happening.

我用于清除应用程序缓存的代码:

The code i'm using to clear the app cache:

- (void)viewDidLoad {

    [super viewDidLoad];

    [[NSURLCache sharedURLCache] removeAllCachedResponses];

}

我们非常感谢您的帮助!

Help is appreciated!

推荐答案

您可以使用图书馆自己的高级机制,而不必陷入低级并弄乱NSURLCache的情况:

Rather than go low-level and mess with NSURLCache, you can use your library's own high-level mechanics:

[[Digits sharedInstance] logOut]

这篇关于如何清除目标C中的应用程序缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆