WatchKit 错误 - 无法找到要实例化的接口控制器类“" [英] WatchKit error - unable to find interface controller class '' to instantiate

查看:33
本文介绍了WatchKit 错误 - 无法找到要实例化的接口控制器类“"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我在 WKIInterfaceController 的子类中建立任何连接时,我都会收到错误 WatchKit 错误 - 无法找到接口控制器类 'myClass' 来实例化 和一个活动指示器显示在模拟器并且视图未加载.断开所有连接,视图显示正确但仍然出现错误

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

尝试过

无法找到要实例化的接口控制器类InterfaceController"

WatchKit:无法找到接口控制器类

WatchKit reloadRootControllersWithNames 导致错误,使用 pageController 或之后推/弹出

两个链接暗示了一个错误,如果它是一个错误,那么这肯定不会出现在 XCode 的发布版本中,并且每个人都会遇到相同的行为,渲染 watcKit 却毫无用处?

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?

推荐答案

对于拥有此方案的任何其他人.在创建类时,类必须设置为正确的目标成员身份,即 yourApp WatchKit 扩展 而不是 yourApp WatchKit App.它也可以在界面构建器的 Target 成员资格中进行编辑.

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.

这篇关于WatchKit 错误 - 无法找到要实例化的接口控制器类“"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆