问题
For my iPhone app I'm working on, i want to have the ability to dynamically add or remove sections to the settings area for my app. ideally I'd like to be able to alter the list of options in a multi-value specifier, and also to add new rows that drilldown into copies of one settings page. I haven't seen anything in the apple documentation on this, but is it possible to alter the settings schema at all after compiling?
回答1:
As far as I know, you cannot do this through the SDK, because the application settings schema is based on a plist that is deployed at install time, and your application will not have access to that file at runtime, because of the sandbox.
As many people have noted, the Settings app really stops being useful for anything more than trivial settings. I would suggest adding a preferences section inside your application. But of course I'm not telling you anything useful. =)
回答2:
You can alter it. In X code, you have to create a new file and under Resource -> Settings Bundle
and then go under ApplicationSettings ->Settings.bundle
and edit the root.plist
. It's that easy to start from. Connecting it to connect is another issue.
来源:https://stackoverflow.com/questions/702319/is-it-possible-to-dynamically-alter-an-iphone-apps-settings-page-in-the-setting