문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top