ios:模拟触摸:尝试专用框架时出错 [英] ios: simulate touch: errors when trying private framework

查看:62
本文介绍了ios:模拟触摸:尝试专用框架时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在iOS中模拟触摸.SO中有一些指针建议我可以在私有框架中尝试GraphicsServices/GSEvent.h.但是,当我按照此处的步骤进行操作时,出现了以下错误:

I'm trying to simulate touch in iOS. There some pointers in SO suggest that I could try GraphicsServices/GSEvent.h in the private framework. However, when I followed the steps here, I got these errors:

    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)

有什么建议吗?谢谢

我使用的代码来自使用GraphicsServices.h/GSEvent以及使用Xcode编译CLI iPhone工具.

错误似乎来自此行.

    mach_port_t thePortOfApp = GSCopyPurpleNamedPort...
    GSSendEvent(&record, thePortOfApp);

推荐答案

好的,我认为添加框架时犯了一些错误.不知何故,我的项目现在开始运作.

OK, I think I made some mistakes when I added the framework. Somehow I got my project working now.

我做了几件事之后,错误就消失了.在构建设置中,我将始终" 搜索用户路径更改为"".在用户标题搜索路径中将路径添加到专用标题.另外,在构建短语"选项卡中,我将"GraphicsServices"添加到"<带库的二进制链接" 部分.

The errors have gone away after I did a couple things. In Build Setting, I changed Always Search User Paths to Yes. Added the path to the private header in User Header Search Paths. Also, in Build Phrases tab, I add the GraphicsServices in the Link Binary with Libraries section.

现在,我可以做一些简单的事情,例如GSEventLockDevice()并模拟按下主屏幕按钮.仍然对触摸一无所知.

Now I can do simple stuff like GSEventLockDevice() and simulating pressing home button. Still have no clue about touch.

这篇关于ios:模拟触摸:尝试专用框架时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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