我正在尝试在 iOS 中模拟触摸。SO中有一些指针表明我可以在私有框架中尝试GraphicsServices/GSEvent.h。但是,当我按照此处的步骤操作时,出现以下错误:
Undefined symbols for architecture armv7:
"_GSCopyPurpleNamedPort", referenced from:
-[TestGraphicsServicesAppDelegate application:didFinishLaunchingWithOptions:] in TestGraphicsServicesAppDelegate.o
"_GSSendEvent", referenced from:
-[TestGraphicsServicesAppDelegate application:didFinishLaunchingWithOptions:] in TestGraphicsServicesAppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
有什么建议吗?谢谢
编辑:我使用的代码来自Using GraphicsServices.h/GSEvent 以及使用 Xcode 编译 CLI iPhone 工具。
看起来错误来自这一行。
mach_port_t thePortOfApp = GSCopyPurpleNamedPort...
GSSendEvent(&record, thePortOfApp);