iOS-不建议将隐式强制转换为数据库中的32位

Ada*_*ush 4 xcode core-data nsinteger ios

所有,

请帮忙,我想我快要疯了,但我有一个专为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.
Run Code Online (Sandbox Code Playgroud)

jobIdNSInteger

我需要他们做些什么才能使其在两者中都起作用吗?目前是其中之一。

Ste*_*bic 5

在Swift中,您可以使用以下代码:

@NSManaged var jobId: Int32
Run Code Online (Sandbox Code Playgroud)

它在32位和64位设备上均可正常运行。


Mun*_*ndi 1

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