Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/94.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS NSKeyedArchiver--NSMutableDictionary作为NSPlaceholderDictionary返回?_Ios_Encoding_Nsmutabledictionary_Nskeyedarchiver_Archiving - Fatal编程技术网

iOS NSKeyedArchiver--NSMutableDictionary作为NSPlaceholderDictionary返回?

iOS NSKeyedArchiver--NSMutableDictionary作为NSPlaceholderDictionary返回?,ios,encoding,nsmutabledictionary,nskeyedarchiver,archiving,Ios,Encoding,Nsmutabledictionary,Nskeyedarchiver,Archiving,我有一个大而复杂的对象图。我已经实现了NSCoding来归档和取消归档对象图。正常情况下,一切正常。但在某些高度可复制的情况下,我归档的NSMutableDictionary会作为NSPlaceholderDictionary未归档。这是NSMutableDictionary的私有子类,表示未初始化的字典。它不响应任何常用的NSDictionary方法 我想知道是否有人遇到过类似的问题。如果是这样,你能解决它吗?怎么做 编辑:关于这种情况,我可以说的一件事是,字典本身是深度嵌套的,包含很多字典和

我有一个大而复杂的对象图。我已经实现了NSCoding来归档和取消归档对象图。正常情况下,一切正常。但在某些高度可复制的情况下,我归档的NSMutableDictionary会作为NSPlaceholderDictionary未归档。这是NSMutableDictionary的私有子类,表示未初始化的字典。它不响应任何常用的NSDictionary方法

我想知道是否有人遇到过类似的问题。如果是这样,你能解决它吗?怎么做

编辑:关于这种情况,我可以说的一件事是,字典本身是深度嵌套的,包含很多字典和数组。在它的深处是一个指向另一个正在被创建的对象的指针。对象图是一棵树。树中的大多数对象包含对其父对象的弱引用。问题发生在树的n层深处。崩溃时,堆栈看起来像这样[我已经简化了它]:

0. crash because dictionary is a placeholder
1. depth n initWithCoder -- decode a deep and large dictionary which, prior to encoding contained reference to object at depth n+4.  Said object has not yet been decoded.
2. Apple methods 
3. depth n+1 initWithCoder -- decode reference to parent
4. 38 frames of apple methods for very deeply nested dictionary
5. depth n-1 initWithCoder -- decode a deeply nested dictionary.  Among other things, the dictionary contains a reference to the level n+1 object [inside a lot of nested dictionaries and arrays]
6. Apple methods
7. depth n-2 object initWithCoder -- decode reference to array containing its children

你能解释一下某些高度重复性的情况吗?并且可能提供对象的编码和解码,但不提供;该应用程序仍在开发中,并处于保密协议之下。当我在文本编辑器中检查数据时,数据并没有明显的问题(编码生成plist文件)。你能在不泄露任何信息的情况下解释一下可复制的情况吗?你在字典中的键都是
NSString
的吗?是的。但是价值观是很多不同的东西。