Last active
February 28, 2017 21:17
-
-
Save stephen-francis/f0e2a8a685e99d567432fbf369e2e0fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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