【问题标题】:UNUserNotification "NSInternalInconsistencyException", reason 'use +currentNotificationCenter'UNUserNotification“NSInternalInconsistencyException”,原因“使用+currentNotificationCenter”
【发布时间】:2020-04-30 00:35:58
【问题描述】:

我使用 kivy 创建一个 IOS 项目我成功地将 IOS 项目部署到 Xcode。我试图实现 UserNotifications 框架并通过 pyobjus 访问它,但是当我运行应用程序时。它出于某种原因引发了这个错误,我已经在使用实例 currentNotificationCenter。如果有人对如何调试代码有任何想法,我将不胜感激。这是我的代码日志

*** Assertion failure in -[UNUserNotificationCenter init], /Library/Caches/com.apple.xbs/Sources/UserNotifications_Sim/UserNotifications-281.6/UNUserNotificationCenter.m:66
2020-04-30 01:25:11.610042+0100 pushdemo[2854:117443] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'use +currentNotificationCenter'
*** First throw call stack:
(
   0   CoreFoundation                      0x000000010c65bf0e __exceptionPreprocess + 350
   1   libobjc.A.dylib                     0x000000010c4c79b2 objc_exception_throw + 48
   2   CoreFoundation                      0x000000010c65bc88 +[NSException raise:format:arguments:] + 88
   3   Foundation                          0x000000010bea8cd2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
   4   UserNotifications                   0x0000000118c9d4a8 -[UNUserNotificationCenter init] + 172
   5   pushdemo                            0x0000000107122be4 ffi_call_unix64 + 76
   6   ???                                 0x00006000005a0910 0x0 + 105553122167056
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

【问题讨论】:

    标签: xcode kivy unusernotificationcenter


    【解决方案1】:

    刚刚意识到它是一种类型方法,我一直在尝试将其作为实例网络访问

    【讨论】:

      猜你喜欢
      • 2014-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-06
      • 1970-01-01
      • 1970-01-01
      • 2012-09-25
      相关资源
      最近更新 更多