Quantcast

Path of NSUserDefaults plist

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Path of NSUserDefaults plist

guivho
Hi,

I've been googling around to find a monotouch code snippet to load the
path to the application's NSUserDefaults.StandardUserDefaults plist
file, but did not find it.

Basically, I just want to print that path to the Console when debugging.
That would allow to copy the path and feed it to a plist editor to
verify the expected plist content.

Any help would be appreciated,

With kind regards,


Guido

--
He who makes a beast of himself gets rid of the pain of being a man.
                -- Dr. Johnson
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Path of NSUserDefaults plist

Craig Dunn
never really thought about this before, but a quick look with PhoneDisk indicates the file is at

/Library/Preferences/<bundleid>.plist

this code "should" get a valid path (not tested)

string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder

string libraryPath = Path.Combine (documentsPath, "../Library/"); // Library folder

string plistPath = Path.Combine (libraryPath, "Preferences/YOURBUNDLEID.plist"); // replace YOURBUNDLEID eg. com.xamarin.sampleapp or whatever you've used



On Thu, Apr 12, 2012 at 3:30 AM, Guido Van Hoecke <[hidden email]> wrote:
Hi,

I've been googling around to find a monotouch code snippet to load the
path to the application's NSUserDefaults.StandardUserDefaults plist
file, but did not find it.

Basically, I just want to print that path to the Console when debugging.
That would allow to copy the path and feed it to a plist editor to
verify the expected plist content.

Any help would be appreciated,

With kind regards,


Guido

--
He who makes a beast of himself gets rid of the pain of being a man.
               -- Dr. Johnson
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch



_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Loading...