Why does this not work:
NSInteger temp = 20;
[userSettingsFromFile setObject:temp forKey:@\"aTemp\"];
but this does:
[userS
NSInteger
isn't an object -- it's simply typecast to int
on 32-bit or long
on 64-bit. Since NSDictionary
can only store objects, you need to wrap the integer into an object before you can store it. Try this:
NSInteger temp = 20;
[userSettingsFromFile setObject:[NSNumber numberWithInteger:temp]
forKey:@"aTemp"];