Florent
Florent

Reputation: 21

Refresh table view iphone

I've set a tableview, I have set a system which set if the row have been already selected, I set checkmark accessory for a row which have been seen, I write the row in a plist to an int value. It works well but only when I restart the app or reload the table view in my navigation controller.

I mean when I select a row it pushes a view controller, then when I go back to the tableview checkmark disappear and we do not know if the row have already been selected only when the app restart.

So is there a way to refresh the table view? In the view will appear, for example?

Upvotes: 0

Views: 943

Answers (3)

Irshad Qureshi
Irshad Qureshi

Reputation: 819

For Swift 2

override func viewDidAppear(animated: Bool) {

dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.tableView.reloadData()
})
}

Upvotes: 0

yagrax
yagrax

Reputation: 113

I know it's more than a year later, but for others that come along...this works in iOS 5.0.

[[self tableView] reloadData];

Upvotes: 1

Jakob Borg
Jakob Borg

Reputation: 24425

Have you tried a simple [tableView reloadData]?

Upvotes: 4

Related Questions