Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 NSKeyedArchiver 存储数据。当用户退出我的应用程序时,我想清除我存储的所有数据。我该怎么做呢?似乎没有[NSKeyedUnarchiver unarchiveObjectWithFile:]删除该文件。
[NSKeyedUnarchiver unarchiveObjectWithFile:]
谢谢!
NSKeyedArchiver & NSKeyedUnarchiver只对您的对象进行编码和解码,以便可以存储和检索它们。如果您将数据存储在文件中,只需删除该文件(使用NSFileManager)。如果您将数据存储在其他地方(例如NSUserDefaults,数据库等),那么您需要删除适合存储的数据。
NSKeyedArchiver & NSKeyedUnarchiver
NSFileManager
NSUserDefaults
<label class="checkbox inline"> <input type="checkbox" name="Services[]" value="service1"> Service 1 </label> <label