I couldn't store an NSArray in NsUserDefaults
. The app gets crashed
in this line
[savedData setObject:jsonValue forKey:@"JSONDATA"];
Below is my code. and i have mention my log error below
NSArray *jsonValue =[NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSUserDefaults *savedData = [NSUserDefaults standardUserDefaults];
[savedData setObject:jsonValue forKey:@"JSONDATA"];
[savedData synchronize];
Error log:
*** 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 =>