I need to parse some files in the background mode. How can I do this. Is it NSXMLParser asynchronous?
Asked
Active
Viewed 1,630 times
3 Answers
3
It is not async, but you can always run the parse in another thread using this:
+ (void)detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget withObject:(id)anArgument

Oscar Gomez
- 18,436
- 13
- 85
- 118
-
SO you are saying that we can't parse at the same time on different threads, but we can queue several parsing operations on a single unique background thread? – Plot Mar 10 '15 at 17:15
2
You could use GCD dispatch queues or Operation Queues to run the parsing in the background.
Blocks are fun :)

bryanmac
- 38,941
- 11
- 91
- 99
0
If ios is 4.0+, then you can put NSXMLParser in another class and make the class to be the delegate of your current view controller. It will run at different thread and won't block your main thread.

Raymond Wang
- 1,484
- 2
- 18
- 33