是否可以在后台运行 iPhone 的加速度计? [英] Is it possible to run accelerometer of iPhone in background?

查看:25
本文介绍了是否可以在后台运行 iPhone 的加速度计?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 iPhone 的加速度计来获取加速度计值的日志文件(可能是 24 小时).是否可以让加速度计在其他应用程序运行时在后台运行?

I want to use accelerometer of iPhone to get the log file of accelerometer value (maybe for 24 hours). Is it possible to let accelerometer runs in background while other applications are running?

推荐答案

如果您的应用因其他原因被允许在后台运行,您现在可以这样做.查看 Core Motion API 的 startAccelerometerUpdatesToQueue:withHandler: 方法 此处.

You can do it now, if your app is allowed to run in the background for other reasons. See the Core Motion API's startAccelerometerUpdatesToQueue:withHandler: method here.

这篇关于是否可以在后台运行 iPhone 的加速度计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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