swiftxcodeinterface-builderwatchkitwkinterfacecontroller

How come Xcode Stops letting me hook up IBOutlets after two Interface Controllers?


I was setting the IBOutlets for the first few objects of a Watch App.

However, after doing a few IBOutlets it stops once I get to work on the third InterfaceController, closes InterfaceController.Swift, and instead opens WKInterfaceController.h. It does this every time I try to add the label or button to the code.

Why is this? Should I be approaching this code differently if I'm trying to build a hierarchical program?

Thank you! This is what I want, where I can add in the outlets... image1

But after a few outlets, it automatically opens this page and doesn't let me add anymore... image


Solution

  • Do you mean the right-hand side of the split view showing the code doesn't load the correct class?

    If so, it's probably the reasonably common issue of Xcode not automatically knowing which class to load.

    You can select the class you want to show manually by clicking in the toolbar above the code (i.e. the "two circles" in the second screenshot right above the code), and selecting the correct file