我从Crashlytics收到了以下报告.我没有打电话给[UIFeedbackGenerator _autoDeactivate]
自己.也许有些图书馆正在这样做.我做了一些研究,但找不到任何有用的信息.有谁知道这个崩溃报告意味着什么?谢谢!
致命异常:NSInternalInconsistencyException
自动停用<UISelectionFeedbackGenerator时出现异常:0x1c012d7a0:prepared = 0>对于样式2:强制停用<UISelectionFeedbackGenerator:0x1c012d7a0:prepared = 0>,其样式TurnOn未激活(activationCount = -1)配置:<_UISelectionFeedbackGeneratorConfiguration:0x1c0301710: isEnabled = 1,activationStyle = 2,requiredSupportLevel = 0> activationCount:-1,styleActivationCount:-1引擎:{(<_UIFeedbackHapticEngine:0x1c40dd180:state = 4,numberOfClients = 5,prewarmCount = 0,_isSuspended = 0>)}
这是完整的报告:
# Crashlytics - plaintext stacktrace downloaded by Sen Liu at Tue, 10
Oct 2017 22:21:10 GMT
# URL: https://fabric.io/my-app/ios/apps/MyApp.MyApp/issues/59dd3fa2be077a4dcc13b10e?time=last-seven-days/sessions/a519bdec262e49e0be602410c090e407_6e21562fae0411e7918c56847afe9799_0_v2
# Organization: My Company
# Platform: ios
# Application: MyApp
# Version: 0.9 (28)
# Bundle Identifier: MyApp.MyApp
# Issue #: 7
# Issue ID: 59dd3fa2be077a4dcc13b10e
# Session ID: a519bdec262e49e0be602410c090e407_6e21562fae0411e7918c56847afe9799_0_v2
# Date: …
Run Code Online (Sandbox Code Playgroud) 我想知道我们如何检查UIFeebackGenerator
当前设备上是否有新的iOS 10 API .还有一些我们需要检查的事情:
前两个检查可以使用#available(iOS 10, *)
语句和(hacky)设备检测来实现,但后者似乎不可检查.
有人知道这方面的解决方案吗?或许我们需要为此提交Apple Radar.谢谢!
我正在使用UIFeedback Haptic Engine
与swift 2.3类似:
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(.Warning)
Run Code Online (Sandbox Code Playgroud)
和
let generator = UIImpactFeedbackGenerator(style: .Heavy)
generator.impactOccurred()
Run Code Online (Sandbox Code Playgroud)
今天我遇到了这样一种新的错误,但是找不到问题.你有什么主意吗?
UIFeedbackHapticEngine _deactivate] called more times than the feedback engine was activated
Run Code Online (Sandbox Code Playgroud)
细节:
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x1863e41c0 __exceptionPreprocess
1 libobjc.A.dylib 0x184e1c55c objc_exception_throw
2 CoreFoundation 0x1863e4094 +[NSException raise:format:]
3 Foundation 0x186e6e82c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 UIKit 0x18cc43fb8 -[_UIFeedbackEngine _deactivate]
5 UIKit 0x18cad781c -[UIFeedbackGenerator __deactivateWithStyle:]
Run Code Online (Sandbox Code Playgroud) 有人遇到过这种情况么?特别是在运行iOS 10.0的iPhone 6上,我得到了以下崩溃的一致报告:
if #available(iOS 10.0, *) {
UISelectionFeedbackGenerator()
}
Run Code Online (Sandbox Code Playgroud)
它甚至没有被使用,只是创建并导致EXC_BAD_ACCESS
崩溃.文档称,如果设备不支持它,它就会无声地失败.奇怪的是,如果我改变检查,iOS 10.0.1
它工作正常.
难道我做错了什么?