简体   繁体   English

无论如何都要在APP中的settings.bundle中设置值

[英]Is there anyway to set values in the settings.bundle from within the APP

Is there any way to set/update values in the settings.bundle from within your app. 有没有办法在您的应用程序中设置/更新settings.bundle中的值。 I am fine reading in values from the preferences into NSUserDefaults but was wondering whether you can set values from within the app. 我很好地阅读从偏好到NSUserDefaults的值,但是想知道你是否可以在应用程序中设置值。

I have a web-app which I am making a iPhone client for and was thinking to include the users account details in the settings.bundle. 我有一个网络应用程序,我正在制作iPhone客户端,并考虑在settings.bundle中包含用户帐户详细信息。 This is fine if the user only updates the values through the Apple Application Preferences screens, but what if the user updated those values in the web app. 如果用户仅通过Apple Application Preferences屏幕更新值,那么这很好,但是如果用户在Web应用程序中更新了这些值,该怎么办呢。 I wanted to pull down the values from the web and then "update" the values in the settings.bundle from within the App. 我想从网上下载值,然后从应用程序中“更新”settings.bundle中的值。

I am guessing that this is not possible and that maybe I need to create my own "in-app" settings screen? 我猜这是不可能的,也许我需要创建自己的“应用程序内”设置屏幕? But thought I would check with you all first ... 但是我想先跟你们一起检查......

You're asking two questions here. 你在这里问两个问题。

The first one is if you can update settings from within the application. 第一个是如果您可以从应用程序内更新设置。 You assume you can't, but you can quite easily. 你假设你做不到,但你可以很容易。 Just use NSUserDefault's setObject:forKey: method. 只需使用NSUserDefault的setObject:forKey:方法。

If you want to do in-app settings, I'd start here: How to simplify in app Application Settings management? 如果你想进行应用内设置,我将从这里开始: 如何简化应用程序设置管理?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM