Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dunadan

macrumors newbie
Original poster
May 31, 2009
2
0
Hi,

I'm implementing a notes manager application which has a tableView in a tabBar where the main information of its notes is displayed. When accessing to one note, you can edit its properties. In one button of the tabBar you can choose the way the notes are displayed in the tableView.

The problem I have is that I don't know how to reload the data from a child controller or from the other controller of the tabBar, either. I don't know how to refer to tableView from them so I can use reloadData to update the information of the TableView from them.

I'm quite new in iPhone development... any help will be really appreciated.

Thanks.
 
If the tableview belongs to a subclass of UITableViewController, then you can simply reference the view controller's pointer and tell its tableView to reloadData. Or you can still do it by making ivar of the tableView and call it by referencing its pointer.
 
Solved

I solved it using viewWillAppear:(BOOL)animated and [self.tableView reloadData] inside that function, in the controller of the tableView.

The thing is that now when I come back from the child controllers, the row remains selected unless I select another one. It remains selected even if I click the disclosure button of another row and I come back to the table view. It's weird... any idea about how to solve this?, thanks.

EDIT: Solved using [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.