I’m at the point in Chapter 5 (View Controllers) where I have just added a second view controller and now have an app that allows the user to select between the two view controllers (temperaturew conversion and map view) using a tab bar controller.
The problem I have having is that the temperature conversion view controller intermittently shows up as a black screen in the simulator. The other view controller (map view) works OK.
I’ve tried various things that have appeared to fix the problem, but then the problem has returned and it turns out that they make no difference after all. These include:
Product / Clean before running the app in the debugger.
Product / Clean, then Product / Build, then run it.
Reboot the computer.
Simulator / Reset Content and Settings…
Various combinations of the above.
The intermittent problem happens on a MacBook Pro that is running El Capitan and XCode 7.3.1.
I decided to upgrade a different Mac to MacOS Sierra and the latest XCode (8.2.1). The difference this made is that I consistently get the black screen on the temperature conversion view controller, and the map view controller still works correctly.
Both Macs are somewhat old so I wonder whether there is a timing issue between XCode and Simulator. But I have no hard evidence for this. Both machines have 8GB RAM and a Core 2 Duo processor. They both run XCode (and other applications) acceptably fast.
Does anyone have any ideas? I found some related threads about this type of problem, but for Cocoa and Objective C rather than Swift targeting iOS.