App stürzt ab beim speichern von NSArray in NSUserDefaults

Konnte ich nicht speichern, ein NSArray in NsUserDefaults. Die app bekommt abgestürzt

in dieser Zeile
[savedData setObject:jsonValue forKey:@"JSONDATA"];

Unten ist mein code. und ich habe vergessen meine log folgenden Fehler

NSArray *jsonValue =[NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSUserDefaults *savedData = [NSUserDefaults standardUserDefaults];
[savedData setObject:jsonValue forKey:@"JSONDATA"];
[savedData synchronize];

Fehler melden:

*** Terminating app due to uncaught exception '`NSInvalidArgumentException`', reason: '*** -

[NSUserDefaults setObject:forKey:]: attempt to insert non-property list object <CFBasicHash 0x8c62b10 [0x1d2aec8]>{type = immutable dict, count = 3,
    entries =>

InformationsquelleAutor der Frage iworld | 2014-09-02

Schreibe einen Kommentar