简体   繁体   English

在iOS上缓存,如何在重新启动时删除

[英]Cache on iOS, How to delete on relauch

I decided to import this project on my app i found on github lockscreen . 我决定将这个项目导入我在github lockscreen上找到的应用程序中。 Essentially it works just like the iOS pincode lockscreen but in this case it protects the app from being used a random snoopy person. 从本质上讲,它的工作方式类似于iOS密码锁定屏幕,但在这种情况下,它可以防止应用被随机的窥探者使用。 The lockscreen works my issue is if in case I had set a passcode lock pin and delete the app off my iPhone and reinstall it the lockscreen still askes for to enter a pincode. 锁屏可以解决我的问题,如果万一我设置了密码锁密码并从iPhone上删除该应用程序并重新安装,则锁屏仍然要求输入密码。 I believe this is being caused form a cache storing the set pin codes for the app. 我认为这是由存储应用程序设置的密码的缓存引起的。 Is the a way to delete the cache at relaunch or in the event of deleting the app ? 是否可以在重新启动时或在删除应用程序时删除缓存? I suppose this would be implemented in the delegate? 我想这将在委托中实现? How could you do this 你怎么能这样

Well yes and no. 是的,不是。 The passkey is stored in the keychain, from which you will need to remove it. 密码存储在钥匙串中,您需要从其中删除它。 The way to do that is to check on startup that it is a new install of the app and clear the current value of the passkey form the keychain. 这样做的方法是在启动时检查它是应用程序的新安装,并清除来自钥匙串的密码的当前值。

Since there is not code executed on the removal of you app you can't really do it after or when the app is removed. 由于移除您的应用程序时未执行任何代码,因此您无法在移除应用程序后或移除时真正执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM