简体   繁体   中英

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. 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.

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.

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 ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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