从 iPhone 或命令行程序获取加速度计数据?
请查看以下要点:
https://gist.github.com/969112
本质上,我试图设置一个 UIAccelerometerDelegate 并让它从命令行 iPhone 应用程序接收数据(即它已越狱,我通过 ssh 进入手机并在 iPhone 本身上编译上述代码)。
上面的代码不起作用...即使应用程序位于其运行循环中,并且 UIAccelerometer
与其委托一起处于活动状态,也没有调用任何回调...
我有点不知所措至于还需要什么。我只是想获得最简单的“hello world”示例来获取加速度计数据(不涉及所有臃肿的 UI 并运行完整的应用程序)...
那么有什么想法吗?提前致谢!
Please view the gist below:
https://gist.github.com/969112
Essentially, I am trying to set up a UIAccelerometerDelegate
and have it receive data from a command-line iPhone application (i.e. it's jailbroken, I'm ssh'd into the phone and compiling the above code on the iPhone itself).
The above code does not work... even though the application is sitting in it's run loop, and the UIAccelerometer
is active with it's delegate, no callback's are ever called...
I kind of at a loss as to what else could be needed. I was simply trying to get the most simple "hello world" example of getting at the accelerometer data was (without involving all the bloat of the UI and running a full-on app)...
So any ideas? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果加速计需要
UIApplication
实例才能工作,我不会感到惊讶。I wouldn't be surprised if a
UIApplication
instance was required for the accelerometer to work.