uchicago-mobi / 2016-Winter-Forum

Class Forum for MPCS51030.
3 stars 0 forks source link

Unexpected Nil #211

Closed shuaib88 closed 8 years ago

shuaib88 commented 8 years ago

I'm passing data through a segue, but my destination view controller keeps unwrapping as nil. Any ideas why this might be happening?

screen shot 2016-03-06 at 7 13 14 pm

shuaib88 commented 8 years ago

I figured it out. You can't set the labels etc.. of the destination controller because it hasn't yet been instantiated. But you can set properties of the destination controller. So I just created a "title" property in my destination controller, pushed a value to it in prepare for segue, and then set the text label in view did load for the destination controller.