0

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.

Luai Kalkatawi
  • 1,492
  • 5
  • 25
  • 51

1 Answers1

1

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.

Midhun MP
  • 103,496
  • 31
  • 153
  • 200