I have a problem regarding reload of view.
I use tabbar in my application. When I press home button and my app is in background. Now my problem is start now. I Want that every time my first tab is display.
So, every time I get 1st tabbar's view. But When I get 1st tabbar's view, I call viewDidAppear()
of 1st tabar's viewController in AppDelegate like below:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
self.tabBarController.selectedViewController=[self.tabBarController.viewControllers objectAtIndex:0];
[navigationController1 popToRootViewControllerAnimated:YES];
[navigationController2 popToRootViewControllerAnimated:YES];
[navigationController3 popToRootViewControllerAnimated:YES];
[navigationController4 popToRootViewControllerAnimated:YES];
[navigationController5 popToRootViewControllerAnimated:YES];
simpleTableViewController *s = [[simpleTableViewController alloc]initWithNibName:@"simpleTableViewController" bundle:nil];
[s viewDidAppear:YES];
}
So,viewDidAppear()
is called and data is loaded and log is printed. But view is not reloaded or refreshed. Means there is not any effect in tableview. Data which is loaded from server is displayed in tableview.
I use the following code for reload or refresh view:
[self.view setNeedsLayout];
[self.view setNeedsDisplay];
[tabledata reloadData];
But it is not effected.
Thanks in advance.