How to notify ViewController on parse end with multiple ViewControllers using a single parser.
Posted
by objneodude
on Stack Overflow
See other posts from Stack Overflow
or by objneodude
Published on 2010-05-16T15:56:33Z
Indexed on
2010/05/16
16:00 UTC
Read the original article
Hit count: 174
Hello,
I have created a RSS parser and 3 TableViews and it parses the RSS files fine but I don't know how to notify the TableViewController when parsing has ended so it can update the view. The TableViewController initiates the parser and the parsing of a feed.
parser = [[RSSParser alloc] initWithURL:@"http://randomfeed.com"];
I can access the single feed items like
[parser feedItems];
In parser.m i have implemented the delegate methods of NSXMLParser:
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
- (void)parserDidEndDocument:(NSXMLParser *)parser
So how do i get parserDidEndDocument to notify my controllers so i can add the data to the tableview.
Cheers from a obj-c beginner.
© Stack Overflow or respective owner