是否可以使用“设置”应用程序来存储来自外部传感器(例如 Nike+iPod 应用程序)的偏好设置?
也许这是一个愚蠢的问题,但我想确定一下。
我正在开发一个使用脉搏计的应用程序,我有兴趣让用户设置将在应用程序中使用的脉搏计(每个脉搏计都有一个唯一的 ID)。 由于脉搏计标识符几乎不会改变(但可以改变),因此“设置”应用程序将是管理该信息的正确位置。
我知道我可以以字典的方式使用 NSUserDefaults 来存储值,但我不希望用户在设置应用程序中手动写入传感器的标识符代码。我想从应用程序检测传感器。我知道如何在我的应用程序中执行此操作,但是有什么方法可以在“设置”应用程序中执行此操作吗? 我认为这是不可能的,因为它需要包含在“设置应用程序”中执行的代码,但我不知道这是否是一种方法(“链接”用户默认值与该代码或类似的东西)。
例如,Nike + iPod 应用程序可让您在“设置”应用程序中按照我想要的方式检测传感器。
任何人都可以确认这是不可能的吗(当然,除非是 Nike 并与 Apple 达成协议以将选项包含在“设置应用程序 XD”中)?
Perhaps it is a silly question but I want to be sure about it.
I am developing an app which uses a pulsometer and I am interested in letting the user set the pulsometer which is going to be used in the app (each pulsometer has an unique ID).
As the pulsometer identifier is something that will be hardlyever changed (but it could be changed) Settings App would be the right place to manage that info.
I know I can use NSUserDefaults in a dictionary way to store values, but I don't want the user manually write the identifier code of the sensor in the Settings App. I want to detect the sensor from the app. I know how do that in my App, but is there any way to do it in the Settings App?
I think it is not possible because it requires including code for executing in the Settings App, but I don't know if it is a way to do it ("linking" the userdefaults with that code or something like that).
For example, the Nike + iPod App lets you detect the sensor in the way I want in the Settings App.
Can anybody confirm that it is not possible (of course, without being Nike and making an agreement with Apple to have the option included in Settings App XD)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在启动应用程序后立即使用基于脉搏计的显示选项来为您自己的应用程序“设置”窗格设置选项。您的应用程序必须在运行时检测到它(并确定范围/步骤)。之后,用户可以从您的应用程序更改设置窗格中的下拉菜单/步进器。如果我理解正确的话。
You can set up options for your own app "Settings" pane by using display options based on the pulsometer as soon as you startup your application. Your app would have to detect it when running (and determine the range/steps). After that, the user could change a pulldown/stepper in the settings pane from your app. If I understand you correctly.