Watchkit: Unable to Find Interface Controller Class

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

For anyone else who has this. The class must be set to the correct target membership ie yourApp WatchKit Extension rather than yourApp WatchKit App when creating your class. It can also be edited in Target membership in interface builder.

Unable to find interface controller class 'InterfaceController' to instantiate

I've found the error! It was because of my .m file, it's target membership was MemGame instead of MenGame WatchKit Extension. So I uncheck the first option and selected the third option and now it's running perfectly.
Solution

Apple Watch notification issue: WatchKit error - unable to find interface controller class to instantiate

Two things to recheck,

  • When you have created a new subclass of WKUserNotificationInterfaceController, Have you selected Watchkit extension as a target instead of iOS app target? You can verify this by Select Project > Select Watchkit Extension Target > Build Phases > Compile Sources. Here you should see NotificationInterface.m file created earlier. If you can't see then you have selected wrong target when creating a file. Then solution is you can create a new class with correct target selected.
  • In Storyboard, make sure custom class name is correctly added. Also in Payload file, category name should match with category set to storyboard scene just to avoid future errors.

interface does not define view controller class

The view controller is missing the identifier in the storyboard

reference interfacecontroller in swift, watchkit

You can use the rootInterfaceController property on WKExtension:

WKExtension.sharedExtension().rootInterfaceController


Related Topics



Leave a reply



Submit