Persist property iOS -
i need way of persisting property value can 1 of 2 states on ios devices. value must accessible parts part of application invisible other applications, easy read , write , must survive 1 program run next , os restarts. option best situation on ios?
since data set small,i think nsuserdefaults
should option
//save nsuserdefaults * userdefaults = [nsuserdefaults standarduserdefaults]; [userdefaults setbool:true forkey:@"state"]; [userdefaults synchronize]; //get bool state = [userdefaults boolforkey:@"state"];
Comments
Post a Comment