简体   繁体   中英

Storyboard scene not binding with ViewController

As the question suggests, I have a storyboard scene, which isn't binding with the corresponding ViewController class. I have changed the class name by selecting the file's owner and coupled all the widgets with the corresponding variables in the class. Even after this, the binding doesn't seem to be happening - the IBAction methods aren't firing, the UIImageViews aren't being assigned the right images and so on. Does anyone have any idea why this might be happening?

PS - This scene is opened from another using a modal segue. (If that is helpful)

I believe your only problem here is that you didn't change the class properly your scene is referring to. Double check by:

  1. Selecting your view controller scene in storyboard

  2. In the identity inspector change the default class name to your custom view controller name

Also since you are presenting your scene through a modal segue, i would check you have correctly set your identifier of your storyboard segue. Click on your segue in storyboard then check this value under Attributes Inspector -> Storyboard Segue -> Identifier

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM