Converting (u)int64_t to NSNumbers

喜你入骨 提交于 2019-12-05 02:13:37

long long is 64-bit on 64-bit OS X/iOS platforms. On all OpenStep-descended platforms, numberWithUnsignedLongLong: is correct for uint64_t.

Last time I checked, which factory method you use doesn’t actually affect the representation used anyway; it’s only dependent on the value of the number (unless you use a too-small size, causing it to be truncated).

Update: these days, the correct answer is NSNumber *bobsNumber = @(bob);.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!