ios - Adding new settings to NSUserDefaults -
this question has reply here:
nsuserdefaults intitial setup 2 answersi utilize nsuserdefaults
store app settings.
i need set default value settings.
so added isappfirstlaunch
value defaults , set needed default(initial) values settings in on app first launch.
but add together new settings. in case isappfirstlaunch false
, can't set default value have delete app , install againg.
so question is: how set new settings default values?.
as unserstand if app in appstore
[[[nsbundle mainbundle] infodictionary]objectforkey:@"cfbundleversion"]];
than can store app version in defaults , check if version changed set new defaults.
but debugging? should delete app clean defualts?
you can check whether setting exists (if different null) , if doesn't exist, set default value.
you can add together code app delegate's applicationdidfinishlaunching
method checks if setting null , so, sets it. every setting in app.
ios objective-c nsuserdefaults
No comments:
Post a Comment