You should stick to the NSInteger
data types when possible. So you'd create the number like that:
NSInteger myValue = 1;
NSNumber *number = [NSNumber numberWithInteger: myValue];
Decoding works with the integerValue
method then:
NSInteger value = [number integerValue];