
Hi,
Give me code of NSUserDefaults to store and retrieve the some data.
Thanks

Hi,
You can use following code to save data into NSUserDefaults:
NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
if (standardUserDefaults) {
[standardUserDefaults setObject:myString forKey:@"MyKey"];
[standardUserDefaults synchronize];
}
Use the following code to retrieve the value:
NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
NSString *val = nil;
if (standardUserDefaults)
val = [standardUserDefaults objectForKey:@"MyKey"];
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.