I have in my code NSUserDefaults but then, when I needed to adjust it, I do something like this:
// OLD save
NSInteger myInt = [prefs integerForKey:@"MYINTEGER"];
// if need to be adjusted will be NEW save
if(myInt > index){
myInt--;
[[NSUserDefaults standardUserDefaults] setInteger:myInt forKey:@"MYINTEGER"];
}
Because my problem is when Im reloading it again, it appears adjusted of course after the NEW save.
Just wondering if, is there a way to just reload the previous save?
Thanks
There is no way to get the previous save using NSUserDefaults if you are using single integer value it will overwrite the last value.
instead of single integer value you can take NSArray in NSUserDefaults where last element will give the latest value and previous element give subsequent values. OR try using two keys if you need the previous and new value only.