Scalar type in Managed Object only works for IPhone 5

前端 未结 2 2015
无人及你
无人及你 2021-02-04 18:44

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

When I generated codes for my managed object, I got a mes

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 19:04

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

    "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."

    Documentation

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

    I hope I have helped.

提交回复
热议问题