[Mono-osx] Write to plist
GARRISON, TRAVIS J.
garrisot at otc.edu
Tue Mar 22 17:42:54 EDT 2011
Now that I can read successfully, I can't figure out how to write to a plist. I checked the documentation and I can't really find that much info on the NSMutableDictionary, at least on the Set commands.
static bool SetPlistValue(string filepath, string key, string s_value)
using (var ns = new NSAutoreleasePool())
//Connect to Apple framework
//Commented out cause this is a console app
//Create a new dictonary to hold our plist
NSMutableDictionary plist = new NSMutableDictionary();
//Check to see if the plist exists
//Check to see if the plist has anything in it
plist = NSMutableDictionary.FromFile(filepath);
if (plist != null)
//return the value for our key
NSString valueKey = new NSString(key);
NSString nss_value = new NSString(s_value);
//The plist is empty
//Can't find the plist, correct path?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-osx