I tried for quite some time to find a solution to the problem, which should be fairly simple. I want variables that can be edited in the iPhone settings menu while the application is not running. Basically a configuration file wrapped in the iOS GUI.
This is supposed to be a built-in function in iOS, and while I can find some methods related to it, I cannot find the actual solution.
In the closest way, I get what I want, where it works, like any other variable: it is empty when the application starts and will be scratched again when the application is closed. And still does not appear in the iPhone settings window.
This is the code I have:
private void LoadSettingsFromIOS()
{
_thisUser.SetValueForKey(new NSString("Blargh"), new NSString("SaveCredentials"));
string stringForKey = _thisUser.StringForKey("SaveCredentials");
bool saveCredentials = _thisUser.BoolForKey("SaveCredentials");
chckBoxRememberMe.On = saveCredentials;
}
And my Settings.Bundle Root.pList file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Credentials</string>
<key>Key</key>
<string>SaveCredentials</string>
<key>DefaultValue</key>
<true/>
</dict>
</array>
<key>StringsTable</key>
<string>Root</string>
</dict>
</plist>
Anyone who was messing around with Xamarin iOS and know how it works?