In your AppDelegate.h file
+(NSUserDefaults*)getdefaultvalue;
In Your AppDelegate.m file
static NSUserDefaults *defaultvalue;
+(NSUserDefaults*)getdefaultvalue
{
if (defaultvalue==nil)
{
defaultvalue=[NSUserDefaults standardUserDefaults];
return defaultvalue;
}
return defaultvalue;
}
In your class where you want to save data or string Ex.
[[AppDelegate getdefaultvalue] setObject:@"FacebookLogin" forKey:@"NORMALOGIN"];
Now Remove from apps and print the value of string in
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSLog(@" string == %@",[[AppDelegate getdefaultvalue] valueForKey:@"NORMALOGIN"]);
Return YES;
}
You got String value.