refresh uitableview on button click
I have 2 views in my app
1st view: tableview and button(update) 2nd 开发者_JAVA百科view: detail viewI want to refresh table in 1st view when I am pressing update button.
If I understand you correctly you want to reload the data if you come back from the DetailView?
then put it in viewWillAppear:
or viewDidAppear:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[tableView reloadData];
}
then connect your button in interfacebuilder or with
[yourButton addTarget:self action:@selector(reloadTableView:) forControlEvents:UIControlEventTouchUpInside];
to this method
- (IBAction)reloadTableView:(id)sender {
[tableView reloadData];
}
精彩评论