Question

Propriété 'Latitude' est un type scalaire sur la classe 'LatitudeLongitude'. Impossible de générer une méthode setter pour elle.

Quand je codes générés pour mon objet géré, je reçu un message si je veux des propriétés scalaires pour le type de données primitive. dois-je utiliser? Je veux que cette application soit compatible avec l'iPhone 3 - 5

est-il des problèmes avec ce problème?

Était-ce utile?

La solution

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.

Autres conseils

This is not true, scalars have been supported in Core Data out of the box for a long time. You do not have to implement custom accessors as many blog posts out there indicate.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top