iphone - How do I register defaults in MonoTouch? -


i want register default values in nsuserdefaults user settings not return null values values not explicitly set user, rather return default values specified in settings bundle. read here:

how register user defaults using nsuserdefaults without overwriting existing values?

that following should executed in applicationdidfinishlaunching:

[[nsuserdefaults standarduserdefaults] registerdefaults:[nsdictionary dictionarywithcontentsoffile:[[nsbundle mainbundle] pathforresource:@"defaults" oftype:@"plist"]]]; 

how can done in monotouch?

you try along lines of:

nsuserdefaults.standarduserdefaults.registerdefaults(nsdictionary.fromfile("defaults.plist")); 

(assuming you've created defaults.plist file default values in! (and it's in root of bundle!))


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -