受管对象中的标量类型仅适用于iPhone 5 [英] Scalar type in Managed Object only works for IPhone 5

查看:114
本文介绍了受管对象中的标量类型仅适用于iPhone 5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

属性纬度"是类"LatitudeLongitude"上的标量类型.无法为其生成setter方法.

Property 'Latitude' is a scalar type on class 'LatitudeLongitude'. Cannot generate a setter method for it.

当我为托管对象生成代码时,我收到一条消息,是否需要原始数据类型的标量属性.我应该使用它吗?我想使该应用程序与iPhone 3-5兼容

When I generated codes for my managed object, I got a message whether I want scalar properties for primitive data type. should I use it? I want to make this application compatible with iPhone 3 - 5

这个问题有问题吗?

推荐答案

使用标量属性时,必须自己为这些属性提供getter和setter的实现,如文档所述:

When you use scalar properties you have to provide implementations of getters and setters for those properties by yourself, as described in documentation:

您可以将属性声明为标量值,但对于标量值,Core Data无法动态生成访问器方法-您必须提供自己的实现(请参阅托管对象访问器方法".).Core Data自动合成原始访问器方法(primitiveLength)和setPrimitiveLength :),但您需要声明它们以禁止编译器警告."

"You can declare properties as scalar values, but for scalar values Core Data cannot dynamically generate accessor methods—you must provide your own implementations (see "Managed Object Accessor Methods"). Core Data automatically synthesizes the primitive accessor methods (primitiveLength and setPrimitiveLength:), but you need to declare them to suppress compiler warnings."

文档

在这个地方,我建议您查看此帖子 core-data-scalars .

At this place I would recommend you to check this post core-data-scalars.

我希望我能帮上忙.

这篇关于受管对象中的标量类型仅适用于iPhone 5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆