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 写入磁盘的大型 NSDictionary。由于该字典可能/将非常大,因此将整个内容加载到内存中是不可行的。什么是分块加载字典的最佳方法,使用该块,然后继续下一个等,从而节省内存。
不要NSkeyedArchiver用来归档一个NSDictionary包含所有对象的大文件。
NSkeyedArchiver
NSDictionary
encodeObject:forKey:使用unarchive归档对象decodeObjectForKey:。 这样您就不需要NSDictionary为了检索一个对象而取消整个归档。
encodeObject:forKey:
decodeObjectForKey: