Hello,
My iphone app retrieve data from a RestServer in the following format:
{
data => (
{
date => "20100710T12:21:23+02:00",
value => 0.1
},
{
date => "20100710T12:30:23+02:00",
value => 25
},
...
{
date => "20100710T15:21:23+02:00",
value => 3
}
),
field1 => value1,
field2 => value2
}
Today, I loop though the array (objectAtIndex:0) and save in Core Date each object like:
{
date => "20100710T15:21:23+02:00",
value => 3
}
I have created an Entity in core data (Measure) with 2 properties (date, value). Is there a mean to save directly the array without having to save the elements one after the other ?
well, I have forgotten an important point in fact. On top of this I would need the data to be inserted only if there is not already a value for this date. The date is knid of the primary key in this case. According to what I read I do not think this is a possible feature out of the box for core data. In that case, is there a quickest way to do this rather than checking the record existence one by one before inserting it in the DB ?
Thanks a lot, Luc