Friday, July 25, 2014

NSUserDefault usage

 //Set NSUserDefault
NSString *somePersistantValue = @"null";
    
[[NSUserDefaults standardUserDefaults] setObject:somePersistantValue forKey:@"keyName"];

[[NSUserDefaults standardUserDefaults] synchronize];

 //Get NSUserDefault
NSString *fetchPersistantValue = [[NSUserDefaults standardUserDefaults] objectForKey:@"keyName"]; 

1 comment: