In my App, I am trying to implement SettingView
by NSUserDefault
. So, I wrote program code as follows:
Method example of saving user setting:
+ (void)setUserAutoPlaySetting:(BOOL)setting {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setBool:setting forKey:kAutoPlaySettingKey];
[userDefaults synchronize];
}
This method is received user setting as BOOL
and saves by NSUserDefault
.
I confirmed my App save user setting on simulator but not on real Device.
In addition, this method is enable to save NO
but disable to save YES
on a real device.
Can anyone please tell how can I overcome this problem? Thanks.