Mögliche Duplizieren:
Storing custom objects in an NSMutableArray in NSUserDefaults
How to store custom objects in NSUserDefaultsWie füge ich ein Objekt in NSMutableArray hinzu, um es in NSUserDefaults zu speichern?
Ich habe versucht, ein Objekt aus einer Klasse instanziiert zu speichern I "Animal" in einem NSMutableArray genannt schrieb in NSUserDefaults gespeichert werden. Allerdings bekomme ich diesen Fehler.
[NSUserDefaults setObject:forKey:]: Attempt to insert non-property value '(
"<Animal: 0xcea7060>"
)' of class '__NSArrayM'. Note that dictionaries and arrays in property lists must also contain only property values.
Was bedeutet das? Vielleicht kann ich Objekte in NSMutableArrays nicht speichern, um in NSUserDefaults gespeichert zu werden?
möglich Duplikat von [Wie benutzerdefinierte speichern Objekte in NSUserDefaults] (http://stackoverflow.com/q/2315948/); auch http://stackoverflow.com/q/7459585/, http://stackoverflow.com/q/537044/ und http://stackoverflow.com/q/471830/ –