Question

I was trying to save a NSString to NSUserDefaults. Its working fine in iOS6,iOS5 versions. But in iOS7 its crashing with a message

[NSUserDefaults setObject:forKey:]: attempt to insert non-property list object

NSUserDefaults *missedValues=[NSUserDefaults standardUserDefaults];
NSMutableDictionary *temp=[[NSMutableDictionary alloc]init];
[temp setObject:name forKey:@"missedName"] ;
[missedValues setObject:temp forKey:@"missed"];
[missedValues synchronize];

An exception is thrown when setObject method is called. How can this be fixed ? The issue is only with iOS7.

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top