Parsing on B-thread but values to main thread?

nick080

New Member
I am very new to threading. Here's my problem. I have a custom Parser class, which uses NSXMLParser and also does some other minor things. It parses a XML from the network and creates a dictionary of values.I also have a DataProcesor helper class which processes the data (NSDictionary) that is passed to it from Parser and creates real CoreData objects from it in a managed context. Now I want to move my Parser to a background thread. How would I do it? (NSthread, NSOperation, GCD...)?How should the Parser return those NSDictionaries to the Data Processor that is on the main thread?The Parser object conforms to NSXMLParserDelegate protocol ie. it procesess the callbacks from NSXMLParser which the Parser owns.
 
Back
Top