0

I am following the Udacity tutorial on Swift, and for some reason when I added the second view, I usually get a black screen (as in the screen print) right when I open the app. Occasionally I get it working but usually not.

  1. What could be the problem?
  2. Noticed that "Did appear" is printed before "Will appear", is that a bug or did I do something wrong?

I have read this and this but it didn't help much. I also have tried several times to clean the project and rebuild it (nothing changed).

One time I just commented out some code (from the second view that should be loaded) and it worked suddenly. When I uncommented the same code it still worked.
Another time it worked when I disconnected the second view on the story board (it was still there, just no way to reach it).
Both have worked at least one time, and not worked many times.

Sorry this seems like I throw in random pieces of information, but I have no idea what could be the reason.

Screenshot

Community
  • 1
  • 1
Ramzi Khahil
  • 4,932
  • 4
  • 35
  • 69
  • 3
    You're printing Did Appear in viewDidLoad so it's normal to have it before Will Appear – Fabio Felici Dec 19 '14 at 09:00
  • First of all, its viewDidLoad is getting called before viewWillAppear which is correct viewController life cycle. Try implementing viewDidAppear method as well and correct your println texts (suggest you to copy-paste method name) – Mrunal Dec 19 '14 at 09:01
  • Try to change the background color of your UIViews and debug it like that and try to uncomment your hidden properties(of lblRecording,stopRecording ... etc.) to see what is going on. – Ersin Sezgin Dec 19 '14 at 09:19
  • 1
    [Related](http://stackoverflow.com/questions/22158136/uiimagepickercontroller-in-storyboard-uiimagepickercontrollersourcetypephotolib) and [related](http://stackoverflow.com/questions/21145270/ios7-storyboard-image-picker-not-working), so try manual init? Seems to be something odd about certain VCs not being loaded properly... and yes, in the case of the image picker, a bug. – stevesliva Dec 19 '14 at 17:08

0 Answers0