iphone - Is it possible to use NSThreads for parsing four different URLs using NSXMLParser -
if try parse single http url, done quickly. if have parse 4 different urls @ application launch, feasible use nsthreads , nsoperation queue. can 1 explain small example if possible?
sagos
write nsoperation subclass, , in main method, this:
- (void)main { nsxmlparser *parser = [[[nsxmlparser alloc] initwithcontentsofurl:myurl_] autorelease]; [parser setdelegate:self]; [parser parse]; }
implement parser delegate methods on nsoperation subclass. instantiate subclasses, assign them urls, , add them operation queue. use notifications or delegates know when finished.
Comments
Post a Comment