无法将PushKit框架导入pyobjus

2024-06-02 07:46:34 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图从PushKit框架导入UserNotifications,但我不知道如何调用它,因为我知道pyobjus中唯一的Include函数是AppKit。当我试图从AppKit调用框架时,我没有看到任何从PushKit调用框架的方法。它返回一个错误。下面是我的代码和错误。我将感谢任何帮助

from pyobjus import autoclass
from pyobjus.dylib_manager import load_framework, INCLUDE
load_framework(INCLUDE.AppKit)
UserNotifications = autoclass('UserNotifications')

回溯

Traceback (most recent call last):
  File "/Users/temitayoadefemi/PycharmProjects/test7/mainfile.py", line 5, in <module>
    UserNotifications = autoclass('UserNotifications')
  File "pyobjus/pyobjus.pyx", line 726, in pyobjus.autoclass
  File "pyobjus/pyobjus.pyx", line 85, in pyobjus.MetaObjcClass.__new__
  File "pyobjus/pyobjus.pyx", line 116, in pyobjus.MetaObjcClass.resolve_class
pyobjus.ObjcException: Unable to find class b'UserNotifications'


Tags: infromimport框架错误lineloadframework