How Can i reload data in tableview in view controller in iphone
- by Pugal Devan
Hi, I am new to iphone development. I have created 5 buttons in the view. On clicking the buttons it navigates to the corresponding views. On clicking the "News" button it navigates and displayed the parsing details in the table view.(This table view, I have created View controller and added table view using Interface Builder and i have set all the properties.)
and i go to another button and comes back to the "News" button, every time parsing will happened.How to avoid the multiple parsing when i come back to the button.
i have tried this one and my code is,
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
static int i;
if(i == 0)
{
NSString * path = @"http://www.AAAAAAAAAAAAAAAA.com";
[self parseXMLFileAtURL:path];
i++;
}
[self.newsTable reloadData];
}
}
Now the parsing is happened only time but the datas are doesnt displayed.
My problem is the tableview doesnot reload. newsTable is the instance of the Tableview.
How can i achieve this.
Please help me out.
Thanks.