can not set the bool value of app setting
- by user262325
Hello everyone
I use the codes below to read and write a bool value from my application:
-(void)SaveAppSetting;
{
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
bool b=true;
[defaults setBool:b forKey:@"AnyKey"];
[defaults synchronize];
}
-(void)LoadAppSetting;
{
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
bool b=[defaults boolForKey: @"AnyKey"] ;
}
I found that "LoadAppSetting" worked well, it could get the correct value of item with key "AnyKey".
The function "SaveAppSetting" looked like no function, it reported no error, but it can not change value of the item with key "AnyKey".
"AnyKey" setting in Setting bundle is
item Dictionary
Type String PSToggleSwitchSpecifier
Title String AnyKey's Title
Key String AnyKey
DefaultValue Boolean Checked
Is there any person met the same problem?
Thanks interdev