我有一个自定义类,它是
这是我尝试创建字典的方式:
NSManagedObject
的子类。我想将其存储在字典中,但尝试这样做时,我收到了一个Property list invalid for format: 200
错误。这是我尝试创建字典的方式:
NSDictionary *dictionary =
[NSDictionary dictionaryWithObject: voiceMemo forKey:@"voiceMemo"];
尝试时得到相同的结果
NSDictionary *dictionary =
[NSDictionary dictionaryWithObject: (NSData *) voiceMemo forKey:@"voiceMemo"];
它能够工作,但是当尝试分别保存每个属性时:
NSDictionary *dictionary =
[NSDictionary dictionaryWithObject: voiceMemo.attribute forKey:@"attribute"];
NSDictionary
应该能够存储数据对象,所以我猜,真正的问题是如何将一个 NSManagedObject
对象强制转换为 NSData