Heres what I've tried
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setInteger:HighScore forKey:@"integerkey"];
[prefs synchronize];
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
HighScore = [prefs integerForKey:@"integerKey"];
Implicit conversion loses integer precision: NSInteger
(aka long
) to int
.
On 64-bit platforms,
NSInteger
is a 64-bit quantity, butint
is only 32-bit.I assume that you have declared
so you can change that to
or add an explicit cast
to solve the problem.