Hi I am trying to use NSUserDefaults
to save some default values in database. I am able to save the values in the NSUserDefaults
(even checked it in NSLog
).
Now I need the values in app delegate when the application is restarted. But I am not getting anything in the NSUserDefaults
. Following is my code from my class where I save the values in NSUserDefaults
:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setObject:appDel.dictProfile forKey:@"dict"];
NSLog(@"%@",[prefs valueForKey:@"dict"]);
Following is my code from App Delegagte:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSLog(@"%@",[prefs valueForKey:@"dict"]);
the above code always returns me null. Can some one please help me?