iPhone 应用程序偏好设置

发布于 2024-12-02 08:31:59 字数 903 浏览 1 评论 0原文

我一直在做一些研究,到目前为止我还无法找到如何在应用程序内显示 Settings.bundle 。我找到的指南是:

这些似乎都跳过了步骤:如何从应用程序的视图中显示 plist。我已经设置了视图并设置了 plist 文件,但我不知道如何从视图中显示首选项 plist。我是否需要手动加载所有内容并将它们放入标签、开关等中?

这似乎是一个愚蠢的问题,但老实说我不知道​​。有人能给我解释一下吗?

提前致谢

编辑:澄清;我发现这允许我通过设置应用程序访问首选项。不过,我想通过应用程序本身的选项卡来访问这些内容。

I've been doing some research and so far I've been unable to find out how to display a Settings.bundle inside an application. The guides that I found are:

These all seem to skip a step: How to display the plist from a view in your application. I've got my view set up and my plist file set up, but I have no idea how to display the preferences plist from the view. Do I manually load everything and put them into labels, switches and whatnot?

This may seem like a stupid question but I honestly don't know. Would anyone be able to explain this to me?

Thanks in advance

EDIT: To clarify; I've found out that this allows me to access the preferences through the settings app. However I want to access these through a tab in the app itself.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

站稳脚跟 2024-12-09 08:32:00

http://knol.google.com/k/iphone -sdk-application-preferences#Step_4(3A)_Retreering_Values_of_Settings 似乎准确地描述了如何访问这些...

这是一个一句话,所以我将其粘贴在这里:

NSString* settingValue = [[NSUserDefaults standardUserDefaults] stringForKey:@"<Setting Key>"] 

没有您必须使用的神奇设置键。使用您喜欢的任何内容,下次应用程序加载时它就会出现。

http://knol.google.com/k/iphone-sdk-application-preferences#Step_4(3A)_Retrieving_Values_of_Settings appears to describe exactly how to access these...

It's a one-liner so i'll paste it here:

NSString* settingValue = [[NSUserDefaults standardUserDefaults] stringForKey:@"<Setting Key>"] 

There's no magical setting key that you have to use. Use whatever you like, and it'll be there the next time the application loads.

独自唱情﹋歌 2024-12-09 08:32:00

我遇到了同样的问题;我有一个应用程序,其中 tabBarController 作为我的应用程序的 RootController,另外,我还通过设备的应用程序首选项提供了一个设置菜单(从 plist 加载)。

我确实想将此设置菜单包含到我的应用程序中,作为我的 tabBarController 的其他视图,以避免必须退出我的应用程序才能更改设置。
最后,我准备好了 plist 文件,我只是想知道一种方法来做这样的事情

    [C#]

    settingsController.View = UIView.LoadFromPList("settings.plist");
    tabBarController.addController(settingsController);

......有人知道吗?

I got the same problem; I have an application with a tabBarController as the RootController of my application and, separately, I have a settings menu (loaded from plist) available through the applications preferences of the device.

I do want to include this settings menu into my app as an other view for my tabBarController in order to avoid to have to exit my application to change the settings.
Finally, I have the plist file ready, I just want to know a way to do something like

    [C#]

    settingsController.View = UIView.LoadFromPList("settings.plist");
    tabBarController.addController(settingsController);

... anybody knows ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文