I have three fixed width integer types:
typedef int16_t TABCellManagedDataKey;
typedef int16_t TABCellManagedDataIndex;
typedef int32_t TABCellManagedDataKeyWithIndex;
And this is the code where they’re being used:
TABCellManagedDataKeyWithIndex keyWithIndex = key << 16 | index;
[[self managedModel] setObject:model forKey:@(keyWithIndex)];
With the new @() syntax for NSNumber literals, is it safe to do the following instead?
[[self managedModel] setObject:model forKey:@(key << 16 | index)
Yes. That is fine.
@(N)is the same as[NSNumber numberWithX:N].