Scalar type in managed entity works only for iPhone 5

The Latitude property is a scalar type in the LatitudeLongitude class. Unable to create setter method for it.

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

Are there any problems with this problem?

+6
source share
2 answers

When you use scalar properties, you need to provide getter and setter implementations for these properties yourself, as described in the documentation:

"You can declare properties as scalar values, but for scalar values, Core Data cannot dynamically generate access methods - you must provide your own implementations (see" Access methods for managed objects "). Basic data automatically synthesizes primitive access methods (primitiveLength and setPrimitiveLength :), but you need to declare them to suppress compiler warnings. "

Documentation

At this point, I would recommend that you check this message core-data-scalars .

Hope I helped.

+10
source

This is not true, scalars are supported in Core Data out of the box for a long time. You do not need to implement custom accessors as indicated in it.

+8
source

Source: https://habr.com/ru/post/893557/


All Articles