无论如何都要在APP中的settings.bundle中设置值 [英] Is there anyway to set values in the settings.bundle from within the APP

查看:106
本文介绍了无论如何都要在APP中的settings.bundle中设置值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在您的应用内设置/更新settings.bundle中的值。我很喜欢从偏好中读取值到NSUserDefaults但是想知道你是否可以在应用程序中设置值。

Is there any way to set/update values in the settings.bundle from within your app. I am fine reading in values from the preferences into NSUserDefaults but was wondering whether you can set values from within the app.

我有一个我正在制作的网络应用程序iPhone客户端并且正在考虑在settings.bundle中包含用户帐户详细信息。如果用户仅通过Apple Application Preferences屏幕更新值,那么这很好,但如果用户在Web应用程序中更新了这些值,该怎么办呢。我想从网上下载值,然后从应用程序中更新settings.bundle中的值。

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. 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. I wanted to pull down the values from the web and then "update" the values in the settings.bundle from within the App.

我猜这是不可能的那也许我需要创建自己的应用程序内设置屏幕?但是我想先跟你们一起检查......

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.

第一个是你可以在应用程序中更新设置。你认为你不能,但你可以很容易。只需使用NSUserDefault的 setObject:forKey:方法。

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.

如果你想进行应用内设置,我会从这里开始:如何简化应用程序设置管理?

If you want to do in-app settings, I'd start here: How to simplify in app Application Settings management?

这篇关于无论如何都要在APP中的settings.bundle中设置值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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