Skip to content

Instantly share code, notes, and snippets.

@stephen-francis
Last active February 28, 2017 21:17
Show Gist options
  • Select an option

  • Save stephen-francis/f0e2a8a685e99d567432fbf369e2e0fc to your computer and use it in GitHub Desktop.

Select an option

Save stephen-francis/f0e2a8a685e99d567432fbf369e2e0fc to your computer and use it in GitHub Desktop.
class FoodTableViewController: UIViewController {
var foodStuffs = [Food]() {
didSet {
// looks good, right?
self.tableView.reloadData() // this will crash :( :(
}
}
func update() {
Updater.doSomethingInBackground { foodResults in
self.foodStuffs = foodResults // this will crash!
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment