iPhone: Core Data save Class object -
I have core data in a unit called space. Inside this I have some fields, such as date However, I would like to save the category item that I called annotations.
space (object) | __DATE __ Annotation (Mk Antenna Protocol)
You have two options: < / P>
-
If your
annotationclassNSCodingprotocol (or if you enterNSValueTransformerFor example, you can use the transformable attribute in your core data unit, for example, the core data for yourannotationis automatically serialized / named to deserializeNSValueTransfor Mer. -
You can create a
annotationunit in your core data model. YouCLLocationCoordinate2D for the unit. You will probably create two support using twodoubles and thenCLLocationCoordinate2D. The advantage of
(1) It is easy (if your class is consistent with NSCoding ). (2) The advantage of this is that you can query against the data within the unit Are Even if you are using SQLite continuously store, if you use (1), the data is opaque to SQLite query engine, so you will not be able to query it with the SQLite backend.
Comments
Post a Comment