Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS-不建议对数据库中的32位进行隐式强制_Ios_Xcode_Core Data_Nsinteger - Fatal编程技术网

iOS-不建议对数据库中的32位进行隐式强制

iOS-不建议对数据库中的32位进行隐式强制,ios,xcode,core-data,nsinteger,Ios,Xcode,Core Data,Nsinteger,全部, 请帮忙,我想我快疯了,但我有一个现有的应用程序,是为32位标准设备设计的。但是,当我在64位上运行时,它出现了问题,我得到了以下结果: CoreData: warning: Property 'jobId' is a 64 bit scalar type on class 'JobSummary' that does not match its entity's property's 32 bit scalar type. Implicit coercion to 32 bits

全部,

请帮忙,我想我快疯了,但我有一个现有的应用程序,是为32位标准设备设计的。但是,当我在64位上运行时,它出现了问题,我得到了以下结果:

CoreData: warning: Property 'jobId' is a 64 bit scalar type on class 'JobSummary' 
that does not match its entity's property's 32 bit scalar type.  
Implicit coercion to 32 bits in the database is not recommended.
jobId
NSInteger


我需要为他们做些什么才能在这两个领域都发挥作用吗?当前是一个或另一个。

如果可行,将标量值转换为对象,即
NSNumber
。在新的模型版本中,确保
int
类型是您所需要的(如果您不确定,请将它们变大)

在Swift中,您可以使用以下内容:

@NSManaged var jobId: Int32

它在32位和64位设备上都能正常工作。

问题是
int
NSNumber
等设备都是他们想要的。它们在不同的平台之间变化,实际上是不可移植的。与原语不同,NSNumber应该是可移植的。