I am trying to persist the UISwitch
state in my settings view of my application. Basically it is a UITableView
and contains a few switches to get the u
Instead of using setObject:forKey: try using setBool:forKey:.
[[NSUserDefaults standardUserDefaults] setBool:TRUE forKey:@"SyncAtStartup"];
you can use following code;
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"SyncAtStartup"];
BOOL test = [[NSUserDefaults standardUserDefaults] boolForKey:@"SyncAtStartup"];
if you use following code, it will return YES;
[[NSUserDefaults standardUserDefaults] setBool:TRUE forKey:@"SyncAtStartup"];
BOOL test = [[NSUserDefaults standardUserDefaults] boolForKey:@"SyncAtStartup"];
Just test above code;