I'm in a bit over my head here with the threading. In my core data db I have a table that is based on dates
Code:
date usd eur gbp
2011-11-01 1.0 0.76 0.67
The problem is that the xml feed I query return only one currency at the time. So I have to query my core data datastore to see if a managed object is there, if it is add the value for the currency and if not add a new managedobject.
This was being done in different threads so that I ended up with several managed objects for the same dates.
What I did was
Code:
[self performSelectorOnMainThread:@selector(parseCurrency:) withObject:rootElement waitUntilDone:YES];
This works to a degree, now I don't get any duplicate managedobjects but on the other hand, not all incoming requests get parsed.
What I need to do is to be able to queue up the parse requests and then parse them in the on thread.
I'm not really sure where to start here to be honest so any good pointers would be appreciated