soldiershin
soldiershin

Reputation: 1620

Refresh tableviewcontroller in ios

I am trying to refresh the table view controller when certain task is performed inside a block.I have checked questions on stackoverflow but they deal with refresh option but i want it to just reload view and go to viewDidLoad and ViewWillAppear.This was the suggestions.

[self.tableView reloadData];

but it doesn't seem to work.Any ideas?

Upvotes: 1

Views: 292

Answers (1)

Kailash Gaur
Kailash Gaur

Reputation: 59

You can not reload tableview or update any view inside a block. If you want to update or refresh your table then you will have create a main threaded block and write your code for table refresh on the main thread.

So, try this code:

dispatch_async(dispatch_get_main_queue(), ^{
    enter code here
});

Upvotes: 4

Related Questions