NSValue
and NSNumber
implement NSCoding
protocol so you can use them ..
NSValue
implementes NSSecureCoding
which is inherited from NSCoding
, look at the Reference
So you can use them:
[encoder encodeObject:@(_scores) forKey:scoresKey];
...
_scores = [[decoder decodeObjectForKey:scoresKey] intValue];