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

JSA986 picture JSA986 · Mar 18, 2015 · Viewed 11.6k times · Source

Whenever I make any connections in my subclass of WKIInterfaceController I get error WatchKit error - unable to find interface controller class 'myClass' to instantiate and a activity indicator showing in simulator and the view does not load. Disconnect all conections and the view displays correctly but still get the error

Tried

Unable to find interface controller class 'InterfaceController' to instantiate

WatchKit: unable to find interface controller class

WatchKit reloadRootControllersWithNames causing error, with pageController or after push/pop

Two links suggests a bug, If it is a bug this would surely not be present on the release version of XCode and everyone would experience the same behaviour rendering watcKit all but useless?

Answer

Aleksandr Shcherbakov picture Aleksandr Shcherbakov · Apr 27, 2015

I solved this issue by:

1) deleting trouble-making InterfaceController file and creating it again in the folder for WatchKit Extension in the project (not just in a group in Project navigator). By default xcode gives you Watch App folder - you have to change it.

2) setting class in Interface Builder so that module was set to ProjectName_WatchKit_Extension

If module is not set - xcode won't be able to find your class