How to store a NSUInteger using NSCoding?

后端 未结 4 1278
攒了一身酷
攒了一身酷 2021-02-05 04:03

How do I store a NSUInteger using the NSCoding protocol, given that there is no method on NSCoder like -encodeUnsignedInteger:(NSUIn

4条回答
  •  灰色年华
    2021-02-05 04:38

    That is the best way to do it. It does seem like needless work, but there's no other type available that can portably represent the entire range of values NSUInteger can hold.

提交回复
热议问题