First of all rename your method like the following:
- (void)refreshTableView:(UITableView *)tableView
Then, to call that method you need to perform the following:
[self refreshTableView:yourTableview];
where self
stands for the object that will receive the message. In this case self
is an instance of the object that contains that method.
Now, why do you need to pass also an instance of the table view?
if you have a instance variable for that table view and you have synthesized it (@property/@synthesize
pattern), you could simple do the following:
- (void)refreshTableView
{
[[self myTable] reloadData];
}
and then invoke that method like the following:
[self refreshTableView];
Edit
As danh suggested, if you have a property (or an instance variable), you can also call directly
[[self myTable] reloadData]; // or [self.myTable reloadData];
without passing through refreshTableView
.