Is there any way to store unsigned long in core data?

前端 未结 4 2052
悲&欢浪女
悲&欢浪女 2021-01-06 02:46

CoreData provides Integer 16, Integer 32 and Integer 64 storage, but doesn\'t support any sign qualifiers. You can store an unsigned int (32 bit) as a signed long (64 bit) a

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-06 03:37

    An unsigned long is not 128bits (yet).
    (or do you have a 128bits CPU?)

    On a Mac, depending on your CPU architecture, it may be 32 or 64 bits.

    See with:

    NSLog( @"%u", sizeof( unsigned long ) );
    

    So basically an unsigned long will be compatible will Integer32 or Integer64.

提交回复
热议问题