自定义键盘功能无效且名称无效 [英] Invalid capability and invalid name with custom keyboard

查看:208
本文介绍了自定义键盘功能无效且名称无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个自定义键盘,仅供我自己的应用程序使用.这就是为什么我实际上不使用UIInputViewController而是仅使用UIViewController(并将委托设置为实际上是子类UIScrollView的自定义文本字段的原因)的原因.当我在文本字段上调用becomeFirstResponder()时,它要花费非常长的时间(不仅是第一次,而且是我每次调用此函数),直到键盘真正出现(大约2秒钟).此外,我收到以下错误消息:

I've designed a custom keyboard for the use of my own application only. That's why in fact, I didn't use UIInputViewController but only UIViewController (and set a delegate to the custom text field which is actually a subclassed UIScrollView). When I call becomeFirstResponder() on my text field, it takes incredibly long (not only the first time but each time I call this function) until the keyboard actually appears (around 2 seconds). Furthermore I get the following error messages:

_BSMachError: (os/kern) invalid capability (20)
_BSMachError: (os/kern) invalid name (15)

我不知道这些错误日志来自何处,我唯一能说的是,如果我不将自定义视图控制器的视图设置为文本字段的inputView,而是内置的<像UISlider这样的c5>子类,我既没有收到 any 延迟,也没有收到 any 错误消息.

I don't know where these error logs are coming from, the only thing I can tell is that if I don't set my custom view controller's view as the inputView of my text field but a built-in UIView subclass like UISlider I get neither any delay nor any error message.

对于此问题的任何提示或解决方案,我将不胜感激.

I would really appreciate any hint or solution to this problem, thanks in advance.

顺便说一句:我正在使用Xcode 7.0官方发行版和带有Swift 2.0的iOS 9.0.2-在调试器和释放模式下,模拟器以及设备上都会出现延迟,调试可执行文件处于打开或关闭状态

BTW: I'm using Xcode 7.0 official release and iOS 9.0.2 with Swift 2.0 - the delay occurs on the simulator as well as on the device in both debug and release mode, debug executable switched on or off

推荐答案

在我的情况下,该问题最终通过删除一些约束(实际上是有效的,并且做了应有的约束)得以解决,但是我不认为这是此尴尬错误消息的一般解决方案.

In my case the problem was finally resolved by removing some constraints (that were actually valid and did what they were supposed to), however I don't think that's a general solution to this awkward error message.

这篇关于自定义键盘功能无效且名称无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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