Assuming you're adding the login view as a modal viewController, you need to refresh the table after each additional login. In your viewWillAppear method reload your tableView:
Or, if your table takes a while to reload, you can send a notification to the viewController to reload the tableView from the login view before you dismiss it.
Similarly, ensure that your viewWillAppear method isn't being thwarted by something in your viewDidUnload method.
Lastly, and in the same vein, understand that if your view gets dumped by the OS for memory reasons, it will sometimes call your viewDidUnload method as it clears it out, but sometimes seems to not call it, perhaps because the memory used by the view was so great that a failure to clear things out in its didReceiveMemoryWarning method made it decide to just dump the view immediately and completely, without really allowing it to clean itself up.
i have not done any code in view didunload method of my controller
@Rani Ok, did you understand my other suggestions? Does your viewDidLoad expect certain data to be in place that is no longer available? Is there some unexpected state change that make the viewDidLoad or viewWillAppear methods in the viewController with the table in it fail? Also, it could be that the viewDidUnload method in your table's viewController should have code in it, something that resets an application state.
i have a login controller when user enters his username and password and click on the submit button the table view fetches the data from the database and presents the data but the problem is when i click on the left navigation bar item on the navigation ans pop back again to my login controller and enter credentials and click on submit button the tableview is empty.What may be the problem
@Rani Which method loads the table cell data in your viewController with the table? viewDidLoad or viewWillAppear?
Hi @Frederick, viewDidLoad method loads the table cell data in the viewcontroller