Reputation: 552
I have a table view and when I select any row then add a view as a sub view. In sub view I have a button. now I want that when I click on that button then my subview will remove and table view also refresh and some data of main view will also updated.
Upvotes: 1
Views: 1071
Reputation: 153
when you touch on your button , use the following methods:
[yourView removeFromSuperView];
[yourTable deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight];
[yourTable reloadSections:[NSIndexSet indexSetWithIndex:index] withRowAnimation:UITableViewRowAnimationFade];
Upvotes: 0
Reputation: 64
Use Delegation. Remove sub view and call delegate method and use [tableView reloadData]; in delegate method.
Upvotes: 2
Reputation: 3408
You can do it in various ways:
You can use delegate.
Reload tableview in viewWillAppear.
Upvotes: 2