简体   繁体   English

iPhone应用程序首选项

[英]iPhone application preferences

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. 我一直在做一些研究,到目前为止,我一直无法找到如何在应用程序中显示Settings.bundle。 The guides that I found are: 我发现的指南是:

These all seem to skip a step: How to display the plist from a view in your application. 这些似乎都跳过了一步:如何从应用程序中的视图中显示plist。 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. 我已经设置了我的视图并设置了plist文件,但我不知道如何从视图中显示首选项plist。 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. 但是,我想通过应用程序本身的选项卡访问这些。

http://knol.google.com/k/iphone-sdk-application-preferences#Step_4(3A)_Retrieving_Values_of_Settings appears to describe exactly how to access these... http://knol.google.com/k/iphone-sdk-application-preferences#Step_4(3A)_Retrieving_Values_of_Settings似乎准确描述了如何访问这些内容......

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. 使用您喜欢的任何内容,它将在下次加载应用程序时出现。

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. 我有一个tabBarController作为我的应用程序可通过该设备的应用喜好RootController,并单独,我有一个设置菜单 (从plist中加载)的应用程序。

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. 我想将此设置菜单作为我的tabBarController的其他视图包含到我的应用程序中,以避免必须退出我的应用程序来更改设置。 Finally, I have the plist file ready, I just want to know a way to do something like 最后,我准备好了plist文件,我只是想知道一种方法来做类似的事情

    [C#]

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

... anybody knows ? ......有人知道吗?

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

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