Adding a button to an iPhone prefs / settings bundle?

微笑、不失礼 提交于 2019-12-01 20:52:35

问题


Just wondering if it's possible to add a button like the "Clear History", "Clear Cookies" etc buttons in the Safari preferences to your own app's settings bundle? Been digging through the dev docs and can't find any plist specifier for a button, so I'm wondering if this is an internal API for the Apple guys?

After you hit the button, you get an action sheet asking you whether you really want to do it, and then presumably there is some callback based on the user's input.

Also noticed that the Nike + iPod settings have a clear button in them, but again, that app might have access to internal APIs that we don't.


回答1:


No, this is not possible. The system only supports interacting with the values from within your app. You can't run code from the settings app so a button would be useless.




回答2:


Nike+iPod is a root application. Anything running under root can run code from basically anywhere (with restrictions, Sandbox is a b**ch) If you're interested you can make a jailbreak preferencebundle with Theos or iOSOpenDev! Which allows you to make a root bundle that can run button action code.




回答3:


iOSOpenDev, which extends Xcode for iOS jailbreak-style project development, provides project templates that have a check boxes to include either a simple PreferenceLoader (plist-based) or a full PreferenceLoader bundle.



来源:https://stackoverflow.com/questions/3900916/adding-a-button-to-an-iphone-prefs-settings-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!