Question

I use a root.plist file for setting my monotouch iPhone application based on this article:

http://adtmag.com/articles/2010/04/13/working-with-application-settings-in-monotouch.aspx

How we can have a field that by default is invisible and the application, based on conditions, can change the visibility?

Était-ce utile?

La solution

Settings are by default hidden.

If you do this:

var defaults = NSUserDefaults.StandardDefaults;
defaults.SetInt(21, "TestInt");
defaults.Synchronize();

Assert.That(defaults.IntForKey("TestInt"), Is.EqualTo(21));

It will be completely hidden if you don't setup anything in your plist file. (NOTE: I'm using NUnit here)

So if you want something hidden, don't add the value to your Settings.bundle or Root.plist.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top