Hi,
i'm trying to retrieve a value from my preference file which is an integer. The funny thing is that it always returns zero, although it does exist and the names for both integerForKey:
and setIntegerForKey:
are the same.
Here's how I retrieve the value: [defaults integerForKey:@"BackUpSize"];
And here I set it: [defaults setInteger:[sizeSlider doubleValue]*8589934592 forKey:@"BackUpSize"];
I'm stunned. It should work...or am I missing something here?
Thanks
Edit: defaults is created as such: NSUserDefaults*defaults = [NSUserDefaults standardUserDefaults];
Edit: I've tried creating my own NSUserDefaults method for this issue, but it still returns zero.
-(void)setDouble:(double)dou forKey:(id)key
{
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithDouble:dou] forKey:key];
}
-(double)doubleForKey:(id)key
{
return [[[NSUserDefaults standardUserDefaults] objectForKey:key] doubleValue];
}