我有一个包含两种数组:NSUserDefaults的:存储阵列不同,自定义对象
- 没有
- 只有一个字符串对象
- 几个自定义对象
- 一个字符串,几个自定义对象
至NSUserDefaults
。
简短的背景这一点:
I have a core data relationsship between two objects. So any object of Entity A can belong to a category contained in Entity B or belong to no category. I have a search window where you can look of course for specific categories and/or objects that belong to no category. This no category I basically save in my filter array as a specific string.
但我总是得到错误:
Attempt to insert non-property list object.
这是据我现在已经研究了,因为我的自定义对象。但我也可以在这个数组中存储字符串并混合对象类型吗?我也想过为每个对象分配一个默认类别,但我认为它没有类别是更清晰的,只是在我需要的地方解决这个字符串问题时,在我的应用程序中使用过滤器。
选中此项:试图将非属性列表对象设置为NSUserDefaults](http://stackoverflow.com/questions/19720611/attempt-to-set-a-non-property-list-object-as-一个-NSUserDefaults的)。这是由于将自定义对象添加到NSUserDefaults中。这是不允许的。 –