0

I'm trying to open a modal InterfaceController from a Menu in WatchOS 2. This works fine by calling the Controller in the following way:

@IBAction func doInfoMenuAction() {
    self.presentControllerWithName("InfoInterfaceController", context: nil)
}

The InfoInterfaceController is completely "empty":

import Foundation
import WatchKit

class InfoInterfaceController: WKInterfaceController {
}

When I add a label to the InfoInterfaceController I get a strange behavior: After pressing the Menu Info-Item, the dialog appears but the label doesn't get painted. Instead the waiting spinning wheel is displayed in an endless loop.

The InfoInterfaceController looks in that case like:

import Foundation
import WatchKit

class InfoInterfaceController: WKInterfaceController {

    @IBOutlet var serverUriLabel: WKInterfaceLabel!
}

The IBOutlet was created by CTRL-Linking the Label from the Storyboard to the InfoInterfaceController. If I delete the link and the IBOutlet, the InfoInterfaceController get's painted without a problem. Even the label is displayed fine.

Any idea what I'm doing wrong?

Dirk
  • 1,064
  • 1
  • 11
  • 13

1 Answers1

0

I found the solution: It seems to be the same problem as documented here:

WatchKit error - unable to find interface controller class '' to instantiate

What i had to do is: Open the "Identity Inspector" of the InfoInterfaceController and select another InterfaceController.

After doing so: Simple switch back to InfoInterfaceController in the "Identity Inspector". Clean and Build and afterwards the label shows fine for me.

Looks like a bug to me :-/

Community
  • 1
  • 1
Dirk
  • 1,064
  • 1
  • 11
  • 13