Luai Kalkatawi
Luai Kalkatawi

Reputation: 1492

Refreshing RSS data in TableView

I am trying to refresh my TableView while I am parsing RSS. Once I update the xml and then I press on refresh button it wont make anything but when I close and open the app it runs the new updated xml. Where could be my problem?

-(void)refreshButton{

[self.MyTableView reloadData];

NSLog(@"RSS refreshed");
}

Thanks from now.

Upvotes: 0

Views: 115

Answers (1)

Midhun MP
Midhun MP

Reputation: 107191

The issue is you are parsing the xml from the viewDidLoad. So if the xml is changed then you need to parse it again.

So change the refresh data method like:

-(void)refreshButton
{
  NSXMLParser *parser = [[NSXMLParser alloc] initWithData:newXMLData];
  [parser parse];
  [self.MyTableView reloadData];
}

newXMLData is an instance of NSData and it holds the XML file in the form of bytes.

Upvotes: 1

Related Questions